/build/static/layout/Breadcrumb_cap_w.png
10/09/2009 5243 views
Hi All

I have a VB Script as below

Dim WshShell, objFSO
Set WshShell = WScript.CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists("C:\Program Files\My App\MyApp.txt") Then WshShell.Run("C:\Program Files\My App\MyApp.exe")

It seems to be Erroring out on Line 4 Chr 85 (the start of the WshShell.Run) I cannot see anything obvious, the path does exist since I can copy and paste it into Start\Run and it will launch.

Anyone got any ideas?
0 Comments   [ + ] Show comments

Comments


Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

All Answers

0

Need to have quotes around that path becuase there is a space in it.

See the updated code below.

Dim WshShell, objFSO
Set WshShell = WScript.CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists("C:\Program Files\My App\MyApp.txt") Then WshShell.Run("""C:\Program Files\My App\MyApp.exe""")
Answered 10/09/2009 by: happyphunn
Senior Yellow Belt

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share