Scott Hanselman

Setting the Title of the "DOS" Command Prompt from a Batch File

November 22, '04 Comments [4] Posted in Musings
Sponsored By

Just a small reminder for myself and others that you can set the title of the Command Prompt Window with the "TITLE" Batch Command.

Since I'm building three different branches of our SDK during dev, it's nice to differentiate all these windows on all these monitors.

For example here's "mybuild.bat"

TITLE Building VoyagerFramework 2.0
set BUILDDIR=C:\dev\VoyagerFramework\build
call BUILD.BAT %1 %2 %3 %4 %5

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb
Monday, November 22, 2004 8:41:47 PM UTC
Sometimes it's the littlest things...

Thanks for the tip. Man, you learn something new darn every day...
Tuesday, November 23, 2004 10:22:48 AM UTC
I'm using 4NT as my command line processor, and I've set my prompt to "%@exec[@title %_CWDS][$r] $P$G". This way, the title of the console window displays always the current directory. It's very helpful if you have many console windows in your task bar.
Wednesday, November 24, 2004 6:18:29 AM UTC
excellent tip!
Saturday, November 27, 2004 10:30:37 AM UTC
...and afterwards you can set the color of the window according to the errorlevel to green/red, e.g. with color c0

Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.