starting a windows executable via batch script, exe not in Program Files

Posted by Anthony on Stack Overflow See other posts from Stack Overflow or by Anthony
Published on 2010-03-08T23:50:43Z Indexed on 2010/03/09 0:06 UTC
Read the original article Hit count: 239

Filed under:
|
|

This is probably batch scripting 101, but I can't find any clear explanation/documentation on why this is happening or if my workaround is actually the solution. So basically any terminology or links to good sources is really appreciated.

So I have a program I want to execute via batch script (along with several other programs). It's the only one where the exe is not in a Program Files folder. I can get it to start like this:

C:\WeirdProgram\WeirdProgramModule\weirdmodule.exe

But I get an error along the lines of:

Run-time Error '3024':

Could not find file
C:\Users\MyUserName\Desktop\ModuleSettings.mdb

So it seems that the program is looking for its settings files from the same location that the batch script starts up. Given that I finally got everything to work by doing the following:

cd C:\WeirdProgram\WeirdProgramModule\
weirdmodule.exe

That works fine, and it's not the end of the world to have to go this route (just one extra line), but I've convinced myself that I'm doing something wrong based on lack of basic understanding.

Anybody know or can point me to why it works this way?

Oh, and doing the following:

start "C:\WeirdProgram\WeirdProgramModule\weirdmodule.exe"

doesn't do anything at all.

Thanks,

© Stack Overflow or respective owner

Related posts about Windows

Related posts about batch