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

Program Files referencing...

Status
Not open for further replies.

Ross1811

MIS
Oct 1, 2004
122
US
Hi Everyone,


Does anyone know why when I reference C:\Program Files in my vbscript that it is not able to find anything in it. Seems like it gets confused when there is a white space. All I am trying to do is execute a program at C:\Program Files\etc...


Thanks,
Ross
 
>All I am trying to do is execute a program at C:\Program Files\etc...
[tt]
wshshell.run """C:\Program Files\etc.exe"""
wshshell.run chr(34) & "C:\Program Files\etc.exe" & chr(34)
[/tt]
and many variations on argumens, .run or .exec etc.
 
the .Run method will auto convert environment variables for you, so given the fact that machines might be DE, IT, ES or machines might have different folder structures, i.e. d:\program files i would recommend using something like

sProgFolder = WshShell.ExpandEnvironemntStrings(%ProgramFiles%)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top