Shellexecute path problem even with double quote

J

john.tseven

Hi,

I am trying to use ShellExecute function to invoke the ax program.

The code below works perfect:
ShellExecute(0&, "open", "ax.exe", "C:\2runtemp2.run", "C:\axfolder",
5)

The code below does NOT work:
ShellExecute(0&, "open", "ax.exe", "C:\Documents and Settings\jon
\Desktop\requiredfiles\2runtemp2.run", "C:\axfolder", 5)


Because of some design issues, the arguement "must" have spaces in its
full path. Even though I write the path in double quotations, I can
not prevent this error.


Any help on the error is much appreciated. Thanks,
jon
 
D

Douglas J. Steele

Try:

ShellExecute(0&, "open", "ax.exe", """C:\Documents and
Settings\jon\Desktop\requiredfiles\2runtemp2.run""", "C:\axfolder", 5)

Another, more drastic, approach would be to use the code in
http://www.mvps.org/access/api/api0020.htm at "The Access Web" to return the
short file name equivalent so that there wouldn't be any spaces in it.
 

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