Reputation: 1453
I have a program called program.exe
It's located in the folder:
C:\Program Files\Comp\Soft\program.exe
I want to start it through a bat file but failed to do so.
Everything works when I do this in cmd:
cmd> cd C:\Program Files\Comp\Soft\
cmd> program.exe
// program is running
I tried to do it in a bat file using these combinations:
Start "" "C:\Program Files\Comp\Soft\program.exe"
Start /d "" "C:\Program Files\Comp\Soft" "program.exe"
Start /d /w "" "C:\Program Files\Comp\Soft" "program.exe"
But failed everytime.
What's wrong with my file?
Upvotes: 1
Views: 2128
Reputation: 34899
Yout start
syntax is wrong, you need to specify the working directory immediately after the /D
option:
Start "" /D "C:\Program Files\Comp\Soft" "program.exe"
Or:
Start "" /D "C:\Program Files\Comp\Soft" /WAIT "program.exe"
Upvotes: 1