driconmax driconmax - 16 days ago 8
Bash Question

Resize Command prompt on bat file

Is there any way to start a .bat file and resize the window to a custom size from the code? I don't want to change it from the cmd.exe file because i want it to be dynamic (I want to make a few .bat with different sizes)

@ECHO OFF

rem **Something to resize here**

rem Rest of the code...

pause


Thanks!

Answer

You can use:

mode con:cols=80 lines=40

which I found here. You can modify the numerical values to your specific needs.

I can't test it right now, because I'm on Linux, but I know I used to do the same thing using mode con.

Comments