Command Dialog Box

jstevens
GoldLounger
Posts: 2631
Joined: 26 Jan 2010, 16:31
Location: Southern California

Command Dialog Box

Post by jstevens »

Is it possible to modify the "command dialog box" when a batch file is executed?

All my dialog boxes are displayed as: "C:\Windows\System32\cmd.exe".

I would like for it to describe what the batch file is doing. Such as: "Moving Files" or "My Batch File 01"

Thanks,
John
Regards,
John

User avatar
HansV
Administrator
Posts: 78500
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Command Dialog Box

Post by HansV »

As far as I know, you can't change the caption of the command prompt window.
Best wishes,
Hans

jstevens
GoldLounger
Posts: 2631
Joined: 26 Jan 2010, 16:31
Location: Southern California

Re: Command Dialog Box

Post by jstevens »

Hans,

I found out that you can change the caption in the command prompt window by using "TITLE Hello". The caption will be changed to Hello.

Now the only thing that I need to work out is having this done with a batch file command.

Regards,
John
Regards,
John

User avatar
Leif
Administrator
Posts: 7209
Joined: 15 Jan 2010, 22:52
Location: Middle of England

Re: Command Dialog Box

Post by Leif »

Try adding the title to the first line of code, e.g.:

Code: Select all

TITLE Windows directory listing
dir c:\ | more
This should run a directory listing:
x.jpg
Is that what you want?
You do not have the required permissions to view the files attached to this post.
Leif

User avatar
StuartR
Administrator
Posts: 12610
Joined: 16 Jan 2010, 15:49
Location: London, Europe

Re: Command Dialog Box

Post by StuartR »

If you put the line
@title This is the window caption
at the start of your BAT file then the window caption will be changed to "This is the window caption"
You can use the filename of the current BAT file with the following syntax
@title %~n0
StuartR


User avatar
HansV
Administrator
Posts: 78500
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Command Dialog Box

Post by HansV »

jstevens wrote:I found out that you can change the caption in the command prompt window by using "TITLE Hello". The caption will be changed to Hello.
I apologize, this shows how little I know about command prompts and batch files.
Best wishes,
Hans

User avatar
Doc Watson
4StarLounger
Posts: 412
Joined: 25 Jan 2010, 06:46
Location: New Jersey

Re: Command Dialog Box

Post by Doc Watson »

HansV wrote:
jstevens wrote:I found out that you can change the caption in the command prompt window by using "TITLE Hello". The caption will be changed to Hello.
I apologize, this shows how little I know about command prompts and batch files.
Or, how much you've forgotten. :smile:
If life gives you melons,
You may be dyslexic.

User avatar
HansV
Administrator
Posts: 78500
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Command Dialog Box

Post by HansV »

Doc Watson wrote:Or, how much you've forgotten. :smile:
Perhaps - I can't remember... :grin:
Best wishes,
Hans

User avatar
Bigaldoc
PlatinumLounger
Posts: 3757
Joined: 24 Jan 2010, 11:00
Location: Lexington, KY, USA

Re: Command Dialog Box

Post by Bigaldoc »

HansV wrote:
Doc Watson wrote:Or, how much you've forgotten. :smile:
Perhaps - I can't remember... :grin:
Wait just a minute, you young whippersnapper! CRS is a "disease" reserved for ol' guys like me. You're much too young to be impacted...

Image

jstevens
GoldLounger
Posts: 2631
Joined: 26 Jan 2010, 16:31
Location: Southern California

Re: Command Dialog Box

Post by jstevens »

Stuart,

A :chocciebar: for You.

We all learn something new everyday.

Thanks to everyone in Eileen's Lounge", my life has become less complicated.

Regards,
John
Regards,
John