[英]VBScript compilation error - Error: Expected ')' - 800A03EE
我制作了一個小的登錄腳本,其任務是Mimecast Add-in for Outlook
安裝Mimecast Add-in for Outlook
。
腳本首先檢查插件dll文件是否存在,如果存在,則使用產品版本。 如果版本與我們當前的8.7.4425.0插件相匹配,則它將執行msi的靜默安裝;如果插件dll不存在,則還將執行安裝。
我使用VBSEdit
來構建我的腳本,並且此腳本可以從調試器完美運行。 它找到add-in
版本並執行msi
。
但是,當我使用cscript執行腳本或從Windows資源管理器中雙擊時,出現編譯錯誤。
出於診斷目的,我使用/qb
開關查看msi
執行。
代碼如下。
Dim mimever
Dim instcmd
Dim exist
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("Wscript.shell")
exist = 0
instcmd = "cmd /c start /wait msiexec /i " & Chr(34) & "\\server-01\ict\Software\Mimecast\MSO 7.4\Mimecast for Outlook 7.4.2183.20730 (64 bit).msi" & Chr(34) & " ALLUSERS=1" & " /qb /norestart"
if objFSO.FileExists("C:\Program Files\Mimecast\Mimecast Outlook Add-In\adxloader64.dll") then
exist = 1
End if
If exist = 1 then
mimever = objFSO.GetFileVersion("C:\Program Files\Mimecast\Mimecast Outlook Add-In\adxloader64.dll")
if mimever = null then
mimever = 0
End if
End if
if mimever <> "8.7.4425.0" Or exist = 0 then
ObjShell.Run instcmd
End If
解決方法是將instcmd變量行更改為:
instcmd = "cmd /c start """" /wait msiexec /i " & Chr(34) & "\\server-01\ict\Software\Mimecast\MSO 7.4\Mimecast for Outlook 7.4.2183.20730 (64 bit).msi" & Chr(34) & " ALLUSERS=1" & " /qb /norestart"
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.