The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,595 other followers

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/120 is hex value 0x270f0078 in ScreenBufferSize (default 300 x 80 "ScreenBufferSize"=dword:012c0050").
  • Window height/width 69/120 is hex value 0x00500078 in WindowSize (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:

  1. backslashes are replaced by underscores.
  2. 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:

–jeroen

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

 
%d bloggers like this: