I know you can do right click properties ->layout and there change it manually.
But how would you go about changing it from a Windows batch script?
I know yo
mode con lines=32766
sets the buffer, but also increases the window height to full screen, which is ugly.
You can change the settings directly in the registry :
:: escape the environment variable in the key name
set mySysRoot=%%SystemRoot%%
:: 655294544 equals 9999 lines in the GUI
reg.exe add "HKCU\Console\%mySysRoot%_system32_cmd.exe" /v ScreenBufferSize /t REG_DWORD /d 655294544 /f
:: We also need to change the Window Height, 3276880 = 50 lines
reg.exe add "HKCU\Console\%mySysRoot%_system32_cmd.exe" /v WindowSize /t REG_DWORD /d 3276880 /f
The next cmd.exe you start has the increase buffer.
So this doesn't work for the cmd.exe you are already in, but just use this in a pre-batch.cmd which than calls your main script.