Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resize command prompt through commands

Tags:

batch-file

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?

like image 428
Aaron Avatar asked Dec 31 '11 15:12

Aaron


People also ask

How do I resize in CMD?

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.

What is the Resize command?

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.

How do I resize a DOS window?

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.

How do I resize a batch file?

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.


3 Answers

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.

like image 168
lfxgroove Avatar answered Oct 03 '22 14:10

lfxgroove


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

like image 24
chubakueno Avatar answered Oct 03 '22 14:10

chubakueno


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.

like image 25
TechnoCraft Avatar answered Oct 03 '22 13:10

TechnoCraft