Change the DOS Prompt Size in a Batch File

Posted On 2007-04-14 by FortyPoundHead
Tags: Tip Windows XP
Views: 1641

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 90x30, 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.

About the Author

FortyPoundHead has posted a total of 1974 articles.

Comments On This Post

No comments on this post yet!

Do you have a thought relating to this post? You can post your comment here. If you have an unrelated question, you can use the Q&A section to ask it.

Or you can drop a note to the administrators if you're not sure where you should post.

Your IP address is:

Before you can post, you need to prove you are human. If you log in, this test goes away.

Recent Forum Posts

Advanced search added
dwirch posted on September 23, 2017 at about 13:44 in Site News

Job Spammer: Gaurav Mehta - AgreeYa Solutions
dwirch posted on September 22, 2017 at about 10:35 in Spammers

Job Spammer: Prutha Siri - Javelin Systems
dwirch posted on September 10, 2017 at about 6:15 in Spammers

New security implemented
dwirch posted on September 7, 2017 at about 7:16 in Site News

Malicious IP Checker Companion Tool
dwirch posted on August 12, 2017 at about 20:24 in Site News

Job Spammer: Steve Adams
dwirch posted on August 8, 2017 at about 7:44 in Spammers