[Cmd] how to set Windows default command line window size and buffer size, cmd window
Windows Command Line cmd Window System Default size (80*40) for the current screen configuration is no longer keeping up with the times, we always want to change it bigger, in addition, the buffer size also needs to be greatly changed. Simply modify the display size and buffer size of the current Windows command line window. Right-click the title of the command line window and change the screen buffer and window size in the properties, the system will remember your settings for the command line window with the same title as the current one, such as C: \ Windows \ system32 \ cmd.exe. However, you often open command line windows with different headers, such as Tomat. At this time, it is the default window size of 80*40, and you have to change it again.
So can we directly modify the system's default cmd window and Its buffer size? We will refer to it when we encounter a new title. To change the registry.
First, you can directly specify the size of the command line window under the command line. Go to the command line execution mode and you can see the following information about the console:
Status for device CON: ---------------------- Lines: 2000 Columns: 120 Keyboard rate: 31 Keyboard delay: 1 Code page: 936
This is my default console size of 2000*120. To view the use of the mode command, use mode /? The Display Mode Modification prompt is:
Display mode: mode con [:] [COLS = c] [LINES = n]
You can use the command mode con cols = 120 lines = 40 or mode 120,40 to change the window size to 120*40,
The window size is changed to 120*40, but the page buffer size is also changed to 120*40, which makes it impossible to trace the screen printing history, that is to say, the mode cannot be set separately for the window size and screen buffer size.
If the window size is 120*40 when cmd.exe is started, you can use the/k parameter. The complete command is:
Cmd/k "mode con: cols = 120 lines = 40" or cmd/k "mode, 40"
The ultimate solution is to modify the Registry. First, you must know that the two key values for saving the screen buffer size of the default cmd command window of the system are:
Window Size: HKEY_CURRENT_USER \ Console \ ScreenBufferSize if the value of 120*40 is 002a0078 screen buffer size: HKEY_CURRENT_USER \ Console \ WindowSize if the value of 120*2000 is 07d00078
This is represented by the hexadecimal value. The hexadecimal value can be filled with zero before the hexadecimal value to 8 bits. the first four digits of the hexadecimal system are high, and the last four digits are wide, for example:
The decimal value of 002a0078 0078 is 120,002 a, the decimal value is 40, and the window size is 120*40.
Original link: http://unmi.cc/save-windows-command-size, from: yeye Huang Ying Unmi Blog
07d00078 the decimal value of 00078 is 120, the decimal value of 07d0 is 2000, and the buffer size is 120*2000.
Because hexadecimal truncation is involved into two parts, it is of little significance to directly convert it to a decimal number. For example, the decimal number of 002a0078 is 2752632, who knows what this number has to do with 120*40!
If you think it is difficult to copy the file from another place, set the size of your window and the size of the screen buffer for the window directly entered by command cmd, the Registry will help you create your two key values WindowSize and ScreenBufferSize under HKEY_CURRENT_USER \ Console \ javassystemroot=_system32_cmd.exe, and apply these two values
HKEY_CURRENT_USER \ Console \ WindowSize HKEY_CURRENT_USER \ Console \ ScreenBufferSize
The next time you enter the command line window, the size will be applied by default.
If you know how it works, you can use any tool to modify the two values of the registry. It can be an exported reg file, or use the following two commands to change the window size and screen buffer size to 120*40 and 120*2000 respectively:
12 |
reg add "HKEY_CURRENT_USER\Console" /t REG_DWORD /v WindowSize /d 0x002a0078 /f reg add "HKEY_CURRENT_USER\Console" /t REG_DWORD /v ScreenBufferSize /d 0x07d00078 /f |
At the screen resolution of 1280*1024, I prefer to set the command line window size and screen buffer size respectively: 130*42 and 130*2000. The corresponding command is:
12 |
reg add "HKEY_CURRENT_USER\Console" /t REG_DWORD /v WindowSize /d 0x002a0082 /f reg add "HKEY_CURRENT_USER\Console" /t REG_DWORD /v ScreenBufferSize /d 07d00082 /f |
I like to use the quick edit mode of the cmd window. By the way, I also open it with the command:
1 |
reg add "HKEY_CURRENT_USER\Console" /t REG_DWORD /v QuickEdit /d 0x0000001 /f |
Write down the previous three reg commands and you will be fine. You don't have to set these attributes for the corresponding windows of some titles unless you have any special requirements. For example, if you do not need to set window properties for C: \ Windows \ system32 \ cmd.exe, delete the registry key HKEY_CURRENT_USER \ Console \ cmdsystemroot1__system32_cmd.exe.