Batch file problem

U

user

I created a batch file on a Win98SE computer so that two programs would
start one after another, and tried to use it on a Win XP computer.
Although the paths for the commands were correct, only the first of two
programs in the batch file would run. I could execute the batch file
and only the first program would open. If I opened a new DOS window
after that and executed the second path statement, the second program
would open as I wanted. Is there something unique about starting
successive programs in a batch file in XP that does not apply in Win 98?
Listed below are the batch file lines:

C:\WINDOWS\TWAIN_32\A4S2_600\WATCH.exe

C:\Program Files\iPhoto Plus 4\PROGRAMS\IPE.EXE

I just noticed that spaces were inserted in the second line versus
underscores in the first line. Does this have any effect?? Thanks.
 
M

Mr. Logical

Well, why don't you try putting underscores in the second
line and see if it works?
 
A

Art Sheppard

Use the command line:
C:\"Program Files\iPhoto Plus 4\PROGRAMS\IPE.EXE" or
"C:\Program Files\iPhoto Plus 4\PROGRAMS\IPE.EXE"
for some reason the Command Line Interpret stops interpreting when it runs into a
SPACE in a command line. But the Command Line Interpreter sees a quotation mark
(") it does not stop until it sees another quotation mark, and interprets the full
path.
If you are using the old DOS extend path names ie.
C:\Progra~1\iPhoto~1\PROGRAMS\IPE.EXE it should work fine -- but do not take the ~1
for granite because there may ~2 or ~3.
Hope this helps.
/art
 
T

Tim Slattery

I created a batch file on a Win98SE computer so that two programs would
start one after another, and tried to use it on a Win XP computer.
Although the paths for the commands were correct, only the first of two
programs in the batch file would run. I could execute the batch file
and only the first program would open. If I opened a new DOS window
after that and executed the second path statement, the second program
would open as I wanted. Is there something unique about starting
successive programs in a batch file in XP that does not apply in Win 98?
Listed below are the batch file lines:

C:\WINDOWS\TWAIN_32\A4S2_600\WATCH.exe

C:\Program Files\iPhoto Plus 4\PROGRAMS\IPE.EXE

I just noticed that spaces were inserted in the second line versus
underscores in the first line. Does this have any effect?? Thanks.

You would use underscores if the directories or files being addressed
had underscores in their names. The second command references
directories with blanks in their names, so you need to surround the
whole thing with quotation marks:

"c:program Files\iPhoto Plus 4\PROGRAMS\IPE.EXE"

Otherwise the command processor will think you want it to run a
program located at "c:\Program" and feed the program the rest of the
line as command-line arguments. Clearly, that won't work.
 
A

Alex Nichol

I created a batch file on a Win98SE computer so that two programs would
start one after another, and tried to use it on a Win XP computer.
Although the paths for the commands were correct, only the first of two
programs in the batch file would run. I could execute the batch file
and only the first program would open. If I opened a new DOS window
after that and executed the second path statement, the second program
would open as I wanted. Is there something unique about starting
successive programs in a batch file in XP that does not apply in Win 98?
Listed below are the batch file lines:

C:\WINDOWS\TWAIN_32\A4S2_600\WATCH.exe

C:\Program Files\iPhoto Plus 4\PROGRAMS\IPE.EXE

Two things:

Set the programs going using the start command - eg
start C:\WINDOWS\TWAIN_32\A4S2_600\WATCH.exe
(this also supports a /w switch so you can wait for that program to
finish before going on)

And where there are spaces you need to enclose in quotes, so

start "C:\Program Files\iPhoto Plus 4\PROGRAMS\IPE.EXE"
followed by any parameters etc needed by the program - otherwise it will
assume the space is a terminator, and that you want to run
C:\Program.exe
 

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