Tentando instalar um .exe
usando vbs
. Eu recebo um erro não pode usar parentheses when calling a sub
na linha 11 '. Eu sou relativamente novo no VS e não tenho ideia do que eles estão falando.
Option Explicit
Dim objShell,objFSO,strCommand,spath
'INSTALL ESet ANTIVIRUS USING VBScript
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = WScript.CreateObject("WScript.Shell")
spath = objShell.CurrentDirectory
wscript.sleep 1800000
If objFSO.FolderExists("C:\Program Files\Lightspeed Systems\User Agent") then
objShell.LogEvent vbLogSuccess, sLogHeader & "Lightspeed is already installed." & VbCrLf & "Exit code: " & i
End if
If Not objFSO.FolderExists("C:\Program Files\Lightspeed Systems\User Agent") then
If fso.FileExists(spath & "\Lightspeed\UserAgentx64 V2.1.14.exe") Then
path = """" & spath & "\Lightspeed\UserAgentx64 V2.1.14.exe" & """ /passive /norestart /update-no"
objShell.Run path, 1 ,True
i = 0
'INSTALL ESet ANTIVIRUS
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 & "Lightspeed installation completed successfully." & VbCrLf & "Exit code: " & i
Else
MsgBox "The installation of Lightspeed 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
End If
Else
WScript.Quit (1)
End If
set fso = Nothing
set WSHShell = Nothing
End if