Syntax of Windows XP "start" command

R

Rich Pasco

I've had some trouble spawning a program with the "start" command by
giving its full command path, when said command path includes a space.

For example, suppose I want to launch

C:\Program Files\TextPad 4\TextPad.exe

(TextPad is a popular text editor.)

If I invoke

start C:\Program Files\TextPad 4\TextPad.exe

then I get an error that "Windows cannot find 'C:\Program'..."

Obviously, something is needed to glue the tokens together.

However, if I invoke

start "C:\Program Files\TextPad 4\TextPad.exe"

then instead of Textpad, a command shell is launched with the
above string as its title!

The syntax help for START gives a clue:

START ["title"] [/Dpath] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED]
[/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL]
[/WAIT] [/B] [command/program]
[parameters]

If the first token is quoted, it is assumed to be a window title.

So, to do what I want, it seems I must add a dummy, unused title:

start "Dummy" "C:\Program Files\TextPad 4\TextPad.exe"

Am I correct that "Dummy" or its equivalent is required whenever the
path name includes spaces and thus requires quotes?

- Rich
 
D

Dave Patrick

multi-posted

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

| I've had some trouble spawning a program with the "start" command by
| giving its full command path, when said command path includes a space.
|
| For example, suppose I want to launch
|
| C:\Program Files\TextPad 4\TextPad.exe
|
| (TextPad is a popular text editor.)
|
| If I invoke
|
| start C:\Program Files\TextPad 4\TextPad.exe
|
| then I get an error that "Windows cannot find 'C:\Program'..."
|
| Obviously, something is needed to glue the tokens together.
|
| However, if I invoke
|
| start "C:\Program Files\TextPad 4\TextPad.exe"
|
| then instead of Textpad, a command shell is launched with the
| above string as its title!
|
| The syntax help for START gives a clue:
|
| START ["title"] [/Dpath] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED]
| [/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL]
| [/WAIT] [/B] [command/program]
| [parameters]
|
| If the first token is quoted, it is assumed to be a window title.
|
| So, to do what I want, it seems I must add a dummy, unused title:
|
| start "Dummy" "C:\Program Files\TextPad 4\TextPad.exe"
|
| Am I correct that "Dummy" or its equivalent is required whenever the
| path name includes spaces and thus requires quotes?
|
| - Rich
|
|
 
T

Timo Salmi

Rich said:
So, to do what I want, it seems I must add a dummy, unused title:
start "Dummy" "C:\Program Files\TextPad 4\TextPad.exe"

start "" "C:\Program Files\TextPad 4\TextPad.exe"

All the best, Timo
 

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

Top