Batch file won't open specific file path

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
jsublime
Posts: 4
Joined: 04 Mar 2011 19:38

Batch file won't open specific file path

#1 Post by jsublime » 04 Mar 2011 19:43

Hello,

I have a batch file which opens several programs. I'm having trouble with one of the prgrams not loading.

Here is the target path:

@echo off

C:\a\b\c.exe -run NT_NA WIN_32

If I go to \b directory I can't run c.exe without the "-run NT_NA WIN_32"
which seems to be causing a problem with the script. Any advice?

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Batch file won't open specific file path

#2 Post by aGerman » 05 Mar 2011 05:43

Are there spaces in the path?

Try using the CALL command.

Code: Select all

call "C:\a\b\c.exe" -run NT_NA WIN_32

Regards
aGerman

jsublime
Posts: 4
Joined: 04 Mar 2011 19:38

Re: Batch file won't open specific file path

#3 Post by jsublime » 07 Mar 2011 11:51

That doesn't seem to work either. Yes there are spaces in the path.

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Batch file won't open specific file path

#4 Post by aGerman » 07 Mar 2011 12:37

But you're certain that the arguments -run NT_NA WIN_32 are right?

jsublime
Posts: 4
Joined: 04 Mar 2011 19:38

Re: Batch file won't open specific file path

#5 Post by jsublime » 07 Mar 2011 13:32

Yes. And if I go that directory in a command prompt and type c.exe -run NT_NA WIN_32 it will open the program. If I only enter c.exe it will not enter.

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Batch file won't open specific file path

#6 Post by aGerman » 07 Mar 2011 14:38

Hmm, then you could change the working directory and see what happens.

Code: Select all

cd /d "C:\a\b"
call c.exe -run NT_NA WIN_32

Regards
aGerman

jsublime
Posts: 4
Joined: 04 Mar 2011 19:38

Re: Batch file won't open specific file path

#7 Post by jsublime » 07 Mar 2011 15:54

That did it. Thanks alot!

Post Reply