I want to resize the command prompt window in a batch file, is it possible to set a height and width through something I can just add in the batch file?
Well, in Windows 10, you can do just that. You can now click the resize box in the lower right corner of a Command Prompt window (Figure A) and drag to resize the window to any size you want. Furthermore, you can click the maximize button and have a full screen Command Prompt window.
The resize command resizes a file to the desired modulo and increases or decreases the apparent contiguous portion (or modulo) of the specified file without requiring a file-restore. It either adds or releases the amount of overflow necessary to reach the new modulo, and rehashes all of the items.
You can also resize the window using the sizing handle in the bottom right corner of the window. If you want to adjust the width and height values manually, you can right-click the Title bar and click Properties. In the Properties window, click the Layout tab.
If you just open the batch file, click on the window, and then click "properties", and then to "layout", and scroll down to "Window Size", you can edit it from there.
Modify cmd.exe properties using the command prompt Pretty much has what you're asking for. More on the topic, mode con: cols=160 lines=78
should achieve what you want.
Change 160 and 78 to your values.
mode con:cols=[whatever you want] lines=[whatever you want].
The unit is the number of characters that fit in the command prompt, eg.
mode con:cols=80 lines=100
will make the command prompt 80 ASCII chars of width and 100 of height
Simply type
MODE [width],[height]
Example:
MODE 14,1
That is the smallest size possible.
MODE 1000,1000
is the largest possible, although it probably won't even fit your screen. If you want to minimize it, type
start /min [yourbatchfile/cmd]
and of course, to maximaze,
start /max [yourbatchfile/cmd]
I am currently working on doing this from the same batch files so that you don't have to have two or start it with cmd. of course, there are shortcuts, but I'm gonna try to figure it out.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With