Change the DOS Prompt Size in a Batch File

By | 2007-04-14

Need to create DOS batch files in Windows XP where the prompt size is not the standard 25 lines by 80 columns? Perhaps the batch file needs to display large screens of information and extra lines are needed. Or the batch file may be deployed on a system with a large monitor that can handle 170 columns.

To change the width and height of the current DOS prompt in a batch file, use the mode command with the following syntax:

mode con:cols=COLUMNS lines=LINES

For example, to resize the current DOS prompt to 90×30, use the following command:

mode con:cols=90 lines=30

Note that batch files should execute this command before displaying text as this command will clear the current Windows XP/DOS prompt window.

Author: dwirch

Derek Wirch is a seasoned IT professional with an impressive career dating back to 1986. He brings a wealth of knowledge and hands-on experience that is invaluable to those embarking on their journey in the tech industry.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.