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

后端 未结 14 1423
清歌不尽
清歌不尽 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:34

    I was just searching for an answer to this exact question, come to find out the command itself adjusts the buffer!

    mode con:cols=140 lines=70
    

    The lines=70 part actually adjusts the Height in the 'Screen Buffer Size' setting, NOT the Height in the 'Window Size' setting.

    Easily proven by running the command with a setting for 'lines=2500' (or whatever buffer you want) and then check the 'Properties' of the window, you'll see that indeed the buffer is now set to 2500.

    My batch script ends up looking like this:

    @echo off
    cmd "mode con:cols=140 lines=2500"
    

提交回复
热议问题