Using Shell Command

G

Gibson

Using a Access2003 database in WinXP I am trying to shell over to a third
party software to run it. I am using the code line.
Dim Test
Test = Shell("C:\Directory\File.EXE Config1.XXX")

The 3rd party software is installed in the same directory as the database.
The problem is when the File.Exe runs it looks for other files to load and
claims it can't find them. It claims it can't find file Config1.XXX when it
is there. Apparently File.exe thinks it is running somewhere else than in
its directory. When I create a shortcut on the desktop to run the File.EXE
it works fine. Is there a way to shell to a desktop shortcut? I'd rather
not have my clients have to alt-tab out of the database to the desktop to
run this program

Thanks
 
G

Guest

Look at the command line in your short cut to see if there are any command
line options included. If there are, you will have to add them to your shell
statement. What does this File program do, anyway?
 
D

Douglas J. Steele

It's more likely that the short cut has its Start in property set to the
folder. If that's not done, then you really can't be sure where the program
is going to look for the file.

Easiest will probably be:

Test = Shell("C:\Directory\File.EXE C:\Directory\Config1.XXX")
 
D

Douglas J. Steele

It occurred to me that your sample name may be misleading. If, in fact,
there are spaces in the full path, you'll need to do something like:

Test = Shell("""C:\Directory\File.EXE"" ""C:\Directory\Config1.XXX""")

That's 3 double quotes at the beginning and end, and two sets of double
quotes with a space in between in the middle.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top