Kahn Kah
Kahn Kah

Reputation: 1453

Program won't start through bat file

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

Answers (2)

aschipfl
aschipfl

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

alDiablo
alDiablo

Reputation: 979

Try this

cd "c:\Program Files\Comp\Soft"
start "" program.exe

Upvotes: 2

Related Questions