Scott Hanselman

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

November 22, 2004 Comment on this post [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
Hosting By
Hosted in an Azure App Service
November 23, 2004 0:41
Sometimes it's the littlest things...

Thanks for the tip. Man, you learn something new darn every day...
November 23, 2004 14:22
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.
November 24, 2004 10:18
excellent tip!
November 27, 2004 14:30
...and afterwards you can set the color of the window according to the errorlevel to green/red, e.g. with color c0

:)
dominick

Comments are closed.

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