Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dos in XP

Status
Not open for further replies.

mickyjune26

Technical User
Mar 26, 2002
270
0
0
US
I have a batch file that calls this program:
"c:\program files\CPS\CPS.exe"

The program starts okay, but the batch file stops after starting that program.

When i close the program the batch file finishes processing the rest of the script.

this is windows XP pro.

Thanks,

Micky Fokken
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
 
a) Put the executable as the last line in the batch file
b) Use a "Shell" statement from within your DOS Batch file such as shell "C:\program files\CPS\CPS.exe"

... the shell command should work... it shells off another process and allows the batch file to keep running.

... if that DOESN'T work, you can use the START command instead...

START "C:\Program files\CPS\CPS.EXE"

--Greg

Hope it works for you!
 
Thanks for the tip, but...

shell isn't a recognized command in WinXP command environment.

and start works, but whatever is in quotes, "", is what to label the command window use to start the program.

The start command doesn't work for paths that have a space in them.

Thanks though,

Micky Fokken
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
 
Boy, do I have egg on my face. 8(

--Greg
 
Use the tilde form of long file names/directories.
Program Files = PROGRA~1
 
That did it. Thanks.



Micky Fokken
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
 
I mean, I use Start C:\Progra~1\cps\cps.exe


Micky Fokken
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
 
That should have been
Code:
start "C:\program files\CPS\CPS.exe"
ofcourse [morning]

HTH
TonHu
 
Thanks for wiping a little egg off. :)

--Greg
 
TonHu,
Sorry to bring this up, but whatever is inside the quotes when using the start command....

start "c:\inside quotes"

....tells the start command to open a new command prompt window taht is labeled "C:\inside quotes".

It will not execute what is inside the quotes.

This may only be in Windows XP Pro.
Here is the results of start /? in reference to this feature:

START ["title"]
...then further down....
"title" Title to display in the window title bar.

Thanks for the input,

Micky Fokken
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
 
The CORRECT command is:

start "CPS" /b /w "C:\Program Files\CPS\CPS.EXE"

The /b will not open a new window and run it in your current one, and the /w will WAIT until the command is completed before continuing to the next one.

For a full list of the commands, do START /?

The important thing to know about the START command is that the first set of Quotations is simply a Title or Window Identification of the task and that the switches for the START command must be placed BEFORE your command, not to mix them up with the actual switches for the command.. example:

START "Directory Listing" /b /w "DIR C:\Program Files" /o:n /p



"In space, nobody can hear you click..."
 
Ack.. mistake on that line. .hehe which we could edit posts:

START "Directory Listing" /b/w DIR "C:\Program Files" /o:n /p

The quotation was badly placed at the command.



"In space, nobody can hear you click..."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top