I've made a small logon script, which has a task of installing a Mimecast Add-in for Outlook.
The script first check is the plugin dll file exist and if it does it the takes product version. If the version matches our current 8.7.4425.0 addin then it executes a silent installation of the msi.If the addin dll doesn't exist installation executes as well.
I use VBSEdit to build my scripts and this one runs perfectly from debugger. It finds add-in version and executes the msi.
However, when I execute the script using cscript or double-click from windows Explorer I get compilation error.
for diagnostic purposes I'm using /qb switch to see msi execute.
The code is below.
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 = "cmd /c start """" /wait msiexec /i " & …- JosefZ