How to set the Windows default command line window size and buffer size

Source: Internet
Author: User

How to set the Windows default command line window size and buffer size

Windows command Line CMD Window system default size (80*40) for the current screen configuration is not up to the times, we always have to change it larger, and the size of the buffer also want to change greatly. Simply modifying the display size and buffer size for the current Windows command Line window is simple, right-click the command Line window title, change the screen buffer and window size in the property, the system will remember your settings for the same command-line window as the current title, such as C: Windowssystem32cmd.exe. But often you will open a different title of the command line window, such as Tomat, this time it is the default 80*40 window size, but also to change, and then touch different headings and change.

So can directly modify the system default CMD window and its buffer size, then hit the new title on the reference to it. Ok, the method is to change the registry.

Let's see. You can specify the size of the command line window directly below the command line, and go to the command line to execute mode, and you can see the information about the console as follows:

Status for device CON:




Keyboard rate:31

Keyboard delay:1

Code page:936

This is my default console size is 2000 * 120, see mode command usage, with mode/? The tips for modifying the display mode are:

Display mode:mode con[:] [cols=c] [lines=n]

You can then use Command mode con cols=120 lines=40 or mode 120, 40来 Modify the window size to 120*40,

The window size is changed to the 120*40 you want, but the sad reminder is that the size of the screen buffer becomes 120*40, which makes it impossible to trace the history of the screen printing, which means that mode cannot be set separately for the size of the window and the size of the screen buffer.

If you specify that the window size is 120*40 when you start Cmd.exe, you can/k with the parameter, and the complete command is:

cmd/k "mode con:cols=120 lines=40" or cmd/k "mode 120,40"

The ultimate solution is to modify the registry, first know the system to save the default CMD command Window screen buffer size of the two key values are:

Window Size: hkey_current_userconsolescreenbuffersize If 120*40 values are 002a0078

Screen buffer size: hkey_current_userconsolewindowsize If 120*2000 value is 07d00078

This is represented by the hexadecimal value, and hexadecimal can be zero up to 8 digits to understand. The first four digits of the 16 binary are high and the latter four bits are wide, such as:

002a0078 0078 Decimal is a, 002a decimal is 40, window size is 120*40

07d00078 00078 Decimal is a, 07d0 decimal is 2000, buffer size is 120*2000

Because it involves hexadecimal truncation into two parts, so you want to convert directly to the decimal number to set the meaning is not significant, such as 002a0078 decimal number is 2752632, who knows what this number and 120*40 have any relationship!

If you think this corresponds to calculate trouble, then find a way to copy it from elsewhere, for direct command cmd into the window to set your window size and screen buffer size, the registration table will help you in the Hkey_current_userconsole%systemroot%_ System32_cmd.exe Create your two key values WindowSize and screenbuffersize, apply these values to



OK, the next time you want to enter the command line window, this size will be applied by default.

Know the principle, you want to use what tool to modify the registry of the two values on your own, you can be the exported reg file, or use the following two commands to the window size and screen buffer size to 120*40 and 120*2000 respectively:

REG ADD "Hkey_current_userconsole"/t reg_dword/v windowsize/d 0x002a0078/f

REG ADD "Hkey_current_userconsole"/t reg_dword/v screenbuffersize/d 0x07d00078/f

At the 1280*1024 screen resolution I prefer to set the command line window size and screen buffer size are: 130*42 and 130*2000, the corresponding command is:

REG ADD "Hkey_current_userconsole"/t reg_dword/v windowsize/d 0x002a0082/f

REG ADD "Hkey_current_userconsole"/t reg_dword/v screenbuffersize/d 07d00082/f

I like to use the cmd window of the quick edit mode, by the way also open it, with the command:

REG ADD "Hkey_current_userconsole"/t reg_dword/v quickedit/d 0x0000001/f

Make a note of the previous three Reg commands OK, no special requirements You can set these properties independently of the windows that correspond to some headings. For example, you do not need to set the window's properties for C:windowssystem32cmd.exe to delete the registry key Hkey_current_userconsole%systemroot%_system32_cmd.exe.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.