Null the System Cannot Find the Specified File. Help please
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?
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
Answers (1)
Please log in to answer
Posted by:
happyphunn
15 years ago
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""")
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.