By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,285 Members | 1,659 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,285 IT Pros & Developers. It's quick & easy.

Can SHELL handle a windows switch?

P: n/a
Using the Windows RUN/Open window I can enter the following to open the
application and have it directed to my specified folder:
"C:\Program Files\MyAPplication.exe" "C:\Documents and
Settings\MyUserName\My Documents\MyFolderName"

But if I do this using SHELL in Access 2000 it opens the application
but not the folder:
Call Shell("C:\Program Files\MyAPplication.exe C:\Documents and
Settings\MyUserName\My Documents\MyFolderName", vbNormalFocus)

Why doesn't this work as well? Is it the quote marks?
Thanks,
lq

Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
It's the quotes, but probably not in the sense you meant. You need to have
quotes around the file name and the folder name, just as you do in the Run
window.

To get them in the Shell, try:

Call Shell("""C:\Program Files\MyApplication.exe"" ""C:\Documents and
Settings\MyUserName\My Documents\MyFolderName""", vbNormalFocus)

Note that that's 3 " at the beginning and end, and a pair of " (separated by
a space) in the middle.
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"lauren quantrell" <la*************@hotmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
Using the Windows RUN/Open window I can enter the following to open the
application and have it directed to my specified folder:
"C:\Program Files\MyAPplication.exe" "C:\Documents and
Settings\MyUserName\My Documents\MyFolderName"

But if I do this using SHELL in Access 2000 it opens the application
but not the folder:
Call Shell("C:\Program Files\MyAPplication.exe C:\Documents and
Settings\MyUserName\My Documents\MyFolderName", vbNormalFocus)

Why doesn't this work as well? Is it the quote marks?
Thanks,
lq

Nov 13 '05 #2

P: n/a
Doug,
Yes, that works. Thanks for that. I thought I had tried every
combination of quote marks and single quote marks but not that one!
lq

Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.