调用子程序时的括号

调用子程序时的括号

尝试使用 安装.exevbs我收到错误,无法parentheses when calling a sub在“第 11 行”使用。我对 VS 还比较陌生,不知道他们在说什么。

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

相关内容