C:\_G\WWW\~ELISANET\INFO\tscmd172.html
<http://www.elisanet.fi/tsalmi/info/tscmd172.html>
Copyright © 2003- by Prof. Timo Salmi  
Last modified Mon 10-Dec-2018 13:20:50

 
Assorted NT/2000/XP/.. CMD.EXE Script Tricks
From the html version of the tscmd.zip 1cmdfaq.txt file
To the Description and the Index
 

This page is edited from the 1cmdfaq.txt faq-file contained in my tscmd.zip command line interface (CLI) collection. That zipped file has much additional material, including a number of detached .cmd script files. It is recommended that you also get the zipped version as a companion.

Please see "The Description and the Index page" for the conditions of usage and other such information.



172} How to change and restore the title bar text of the command prompt?

Setting the window title for the command prompt window in a script is straight-forward:
@echo off & setlocal enableextensions
title A title for the command prompt window
endlocal & goto :EOF


So far, so good. But what if we wish only a temporary title for the duration of running a script?
@echo off & setlocal enableextensions
cmd /c title A transient caption
rem Next do whatever
echo Take a look at the title bar
rem Wait for a moment
ping -n 5 127.0.0.1>nul
endlocal & goto :EOF




There is another option, but you'll the have to call the script with cmd /k scriptname and terminate afterwards with exit.
@echo off & setlocal enableextensions
title A transient title
rem Next do whatever
echo Take a look at the title bar
endlocal & goto :EOF



/c "Carries out the command specified by string and then terminates"
/k "Carries out the command specified by string but remains"

The START command has similar connotations, but it is covered in another item.

References/Comments:
  hh ntcmds.chm::/cmd.htm [You can't use this unless you have the ntcmds.chm file]
  hh ntcmds.chm::/start.htm
  hh ntcmds.chm::/title.htm

[Previous] [Next]

C:\_G\WWW\~ELISANET\INFO\tscmd172.html
C:\_G\WWW\~ELISANET\FTPCMD\TSALMI.CMD /tscmd172
http://www.elisanet.fi/tsalmi/info/tscmd172.html
file:///c:/_g/www/~elisanet/info/tscmd172.html