Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shell command not finding file

Status
Not open for further replies.

EddyLLC

Technical User
Mar 15, 2005
304
US
I'm trying to shell out of Access2003 to and exe file that uses an .ini file to set configuration settings. The shell command finds the .exe file and runs it but it gives me an error telling me the .ini file is not found. The .ini file is in the same directory. I have tried moving the .exe and .ini file into the path where the database resides. I also moved them into the Windows and Windows\System32 directory with the same errors.

An shortcut on the desktop works fine as long as I have the correct directory in the Start In box. Anybody have a solution? I'm sure it can be done.

Thanks
 
Not sure if this will help you completely or not - I've found a problem similar to yours, but can't remember what I did to solve it exactly (I'll do some digging) - for now, you can change directories before running the shell command using:

Code:
ChDrive ("C:")'changes current drive
ChDir ("C:\path")'changes current path

Maybe that will help?

Give a man a fish, and you feed him for a day.
Teach a man to fish, and you feed
him for life.
Send a man to Tek-Tips and the poor sap can find out how to fish on his own, and learn more by doing it.
 
Eddy,

If you run the .exe directly from Explorer - does it still run ok?

I have a feeling that you probably normally run it from a shortcut, which will probably provide the path to the .ini?

E.g. thefile.exe /c:\mydocs\thefile.ini

?

ATB

Darrylle




Never argue with an idiot, he'll bring you down to his level - then beat you with experience.
 
Thanks to both of you for your thoughts. I tried the Change directory code and it worked. I never thought of that, I'm always learning from this site.

Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top