How to change Screen buffer size in Windows Command Prompt from batch script

后端 未结 14 1573
清歌不尽
清歌不尽 2020-12-02 09:59

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

14条回答
  •  悲&欢浪女
    2020-12-02 10:33

    I'm expanding upon a comment that I posted here as most people won't notice the comment.

    https://lifeboat.com/programs/console.exe is a compiled version of the Visual Basic program described at https://stackoverflow.com/a/4694566/1752929. My version simply sets the buffer height to 32766 which is the maximum buffer height available. It does not adjust anything else. If there is a lot of demand, I could create a more flexible program but generally you can just set other variables in your shortcut layout tab.

    Following is the target I use in my shortcut where I wish to start in the f directory. (I have to set the directory this way as Windows won't let you set it any other way if you wish to run the command prompt as administrator.)

    C:\Windows\System32\cmd.exe /k "console & cd /d c:\f"
    

提交回复
热议问题