I know basically nothing about vbscripting (just learning now), but was a programmer in a former life. I found some vbscripting code with a google search and want to automate the installation of a software update on numerous computers. I receive "Cannot use parentheses when calling a Sub" but in my simple brain this is an "If" statement, not a "Call" to a sub. I havent had any luck trying to figure out how to debug the code either.
Can anyone point out the error in this coding or why it appears to be a Sub routine. How can I change it to a Call? I'll take all the helpful hints and recommendations your will provide.
'INSTALL CLIENTBASE PLUS Ver 3.04.03 USING VBScript
Set objShell = WScript.CreateObject("WScript.Shell")
spath = objShell.CurrentDirectory
If fso.FileExists(spath & "\cbpupdate30403003.EXE") Then
path = """" & spath & "\cbpupdate30403003.EXE" & """ /s"
objShell.Run(path, 1 ,True)
i = 0
'INSTALL CLIENTBASE PLUS Ver 3.04.03 Build 03
i = objShell.Run(path, 1 ,True)
If (i = 0) Or (i = 3010) Then
'WRITE EXIT CODE [0-success/3010-success&requires reboot] TO EVENTLOG
objShell.LogEvent vbLogSuccess, sLogHeader & "CLIENTBASE PLUS Ver 3.04.03 installation completed successfully." &
VbCrLf & "Exit code: " & i
MsgBox "The installation of CLIENTBASE PLUS returned an error: " & i & VbCrLf & _
"Please contact IT Support to report this error.", vbOKOnly
objShell.LogEvent vbLogError, sLogHeader & "Installation returned failure code: " & VbCrLf & "Exit code: " & i
set fso = Nothing
set WSHShell = Nothing