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

having problems with spaces (program files) 1

Status
Not open for further replies.

GCFII

IS-IT--Management
May 17, 2004
20
US
I am really new to VBScripts and am kinda learing as I go. What I am currently struggling with is trying to run an executable that is located within a directory in program files. If I run it from c:\temp\runme.exe it works fine but if I use the same script and run it from c:\program files\temp\runme.exe it fails. below is the script I am using. Can someone tell me what I am doing wrong?

Set Wshshell=CreateObject("WScript.Shell")

Dim WshShell, wn

WshShell.run "c:\program files\smsinstall\winzip9install\winzip32.exe /autoinstall
 
The embedded space syndrom !
Try this:
WshShell.Run """c:\program files\smsinstall\winzip9install\winzip32.exe"" /autoinstall"

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
It worked! Thanks a million PH.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top