Undo TITLE command

  • Thread starter Thread starter David Trimboli
  • Start date Start date
D

David Trimboli

Is there any way to "undo" the TITLE command in CMD? That is, after
issuing a TITLE command, is there a way to return to the default title
bar, which shows the currently running process (and possibly RunAs
information)?
 
David Trimboli said:
Is there any way to "undo" the TITLE command in CMD? That is, after
issuing a TITLE command, is there a way to return to the default title
bar, which shows the currently running process (and possibly RunAs
information)?

Try this: Title %comspec%
 
Pegasus (MVP) said:
Try this: Title %comspec%
Unfortunately, that solution appears to simply cover-up the problem. By
default, the title appears to be the text of the "shortcut" used to invoke
DOS but %comspec% is shown when run from the main menu - a little like
"PROMPT" but in the title bar.

It would appear that once the title has been changed, control cannot be
returned to the system, so even

TITLE %~f0 %*

won't work consistently.

How about

START "" remainder-of-batch.bat %*
EXIT

to terminate the current batch and start a new session with the same
parameter-set?

Not likely to work too well with redirectors, etc...
 
billious said:
Unfortunately, that solution appears to simply cover-up the problem.
By default, the title appears to be the text of the "shortcut" used to
invoke DOS but %comspec% is shown when run from the main menu - a
little like "PROMPT" but in the title bar.

It would appear that once the title has been changed, control cannot
be returned to the system, so even

TITLE %~f0 %*

won't work consistently.

How about

START "" remainder-of-batch.bat %* EXIT

to terminate the current batch and start a new session with the same
parameter-set?

Not likely to work too well with redirectors, etc...

An interesting workaround. Not really what I was hoping for, but then I
figured there was no way to do it.
 
An interesting workaround. Not really what I was hoping for, but then I
figured there was no way to do it.

This seems to work on XP:

cmd.exe /c BatchFileWhichChangesTitle.cmd

On return from the batch file the title is restored (on my simplistic
test).

Bye,
Dennis
 
dbareis said:
This seems to work on XP:

cmd.exe /c BatchFileWhichChangesTitle.cmd

On return from the batch file the title is restored (on my simplistic
test).

Yes, you're starting a new environment, which includes a new title. When
you exit the new environment, you go back to the old one.

That could actually work for most of the simple scripts I run...
 
Back
Top