How to **not** change the title bar in command prompt when running bat file

Viewed 613

When I use the standard command prompt in Windows and run a bat file (or a bat file that runs a second one) the title bar in the console window changes to the name of the script being run. While I can set the title to anything I want using the TITLE command, that's overriden when running a bat file.

Without modifing the called bat file, how can I preserve the previous title and avoid the change?

Edit

As for why would I want this, let's suppose I have a bat file which sets the console title (for ease of identification) and in turn calls another bat file. During that second bat file execution, the title is lost.

@ECHO OFF
TITLE My bat file is running
REM Some commands run here, custom title is OK

REM Here title is lost and replaced by "AnotherFile"
CALL AnotherFile.bat
REM When the call returns, my custom title returns here

REM More commands with my title again

Question is, how can I preserve the title during the CALL?

0 Answers
Related