Undo TITLE command


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)?
 
Ad

Advertisements

P

Pegasus \(MVP\)

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%
 
B

billious

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...
 
D

David Trimboli

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.
 
D

dbareis [Windows Installer MVP]

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
 
Ad

Advertisements

D

David Trimboli

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...
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top