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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBS vs VBScript "Shell" issue

Status
Not open for further replies.
Mar 13, 2002
28
0
0
AU
I have a VBA program (macro running in Outlook) which happily (i.e., successfully) executes the following code:
Code:
Shell ("M:\Program Files\HPCOMMS\HPCOMMS hp;setyymm")

However, when I attempt to run similar code from VBScript:
Code:
set Shell = Wscript.CreateObject("Wscript.Shell")
Shell.run "C:\Programs\HPCOMMS\HPCOMMS hp;setyymm", 1, True

I get the error:
Code:
The system cannot find the file specified.
with the error code 8007002.

For clarification:
"HPCOMMS" is a compiled VB program;
the string
Code:
hp;setyymm
is a command line parameter for the program.

The syntax is correct as far as I could find out, but maybe there is something wrong in there. Hopefully something simple?!


Best reagrds,
SmallCraig[upsidedown]
 
You are pulling one from the M drive and one from the C drive. Is that a typo?
 
sfvb,

Thanks for the speedy reply - someone's on the ball!

No, it's not a typo, and here's the history. I'm running under a Citrix server environment (Terminal Services stuff, if you're not familiar), and the "programs" drive is the "M:" drive. However, I tried running the program from "M:", and had the same error as I reported in the original post (I'd actually forgotten about it, so I just quickly tested it - same error). I then put the same program under my own "C:" drive, and have been trying it from there.

You know, I've looked at that code a dozen times, and didn't notice the different drive letters!

Thanks for your attention, and I hope I'll hear from you soon,

SmallCraig[upsidedown]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top