vbscript in WIndows 7 64 bit machine
I use the following script to make sure the error is not given while running a SCCM program. I am not able to use in a 64 bit machine. test.cmd has the command to execute the program.Can someone help ?
Dim WshShell, UIv
Set WshShell = Wscript.CreateObject("Wscript.Shell")
On Error Resume Next
UIv = "test.cmd"
WshShell.Run UIv,1,True
If (Err.Number = 0) OR (Err.Number = 1605) Then
WScript.Quit(0)
End If
Set WshShell = Nothing
0 Comments
[ + ] Show comments
Answers (2)
Please log in to answer
Posted by:
aragorn.2003
9 years ago
Posted by:
anonymous_9363
9 years ago
I can't be sure but this might be for the same reason which causes scripts to fail to run "inside" MSIs, viz. that the environment doesn't "know" what Windows Scripting Host is. Try changing this:
Set WshShell = Wscript.CreateObject("Wscript.Shell")
to this:
Set WshShell = CreateObject("Wscript.Shell")
For forum etiquette, please apply the 'Code' style to your code fragment, as I have done here.