Changing the Windows Console Height/Width and screen buffer Height/Width
Posted by jpluimers on 2014/06/27
Console settings are kept in the registry.
The default settings are under HKEY_CURRENT_USER\Console in the DWORD values ScreenBufferSize and WindowSize.
Examples:
- buffer height/width
9999/120is hex value0x270f0078inScreenBufferSize(default 300 x 80"ScreenBufferSize"=dword:012c0050"). - Window height/width
69/120is hex value0x00500078inWindowSize(default 25 x 80"WindowSize"=dword:00190050).
Depending on the window title, settings specific window title (console window name) are in additional keys under HKEY_CURRENT_USER\Console; each key has the name of the “console window name” with two twists:
- backslashes are replaced by underscores.
- your Windows directory is replaced with %SystemRoot%
So if your console window name is C:\Windows\system32\cmd.exe, the key name is HKEY_CURRENT_USER\Console\%SystemRoot%_system32_cmd.exe
If you want to set them all in a visual way, then use the system menu of a console window. Two notes:
- If you add an entry for a Window title, the only way to remove it is through the registry
- You cannot make the buffer height lager than 9999 (but in the registry you can go to 32766 hex 0x7ffe)
If you want to only set the Height of the Buffer, and the Width of the Console and Buffer, you can do this using MODE CON: using a syntax like
mode <cols>,<lines> mode 80,25 mode 120,50 etc.
You can also set it from the .NET Console class properties for instance using VB.NET or PowerShell.
A different console with much more flexibility is the open source Console.
A few links on which the above information is based:
- Why is the Windows cmd.exe limited to 80 characters wide? – Stack Overflow.
- windows – How to change Screen buffer size in DOS Command Prompt from batch script – Stack Overflow.
- PowerShell Code Repository – Set-ConsoleProperties.ps.
- Defaults for CMD.EXE under XP Pro sp3? | Take Command Windows command processor.
–jeroen






Leave a comment