1
votes

I'm trying to silently install MSI packages through a vbscript but when I try to pass switches through all I get is the blank command prompt and the Windows Installer tooltip opens.

Here's a couple ways I've tried this below, but I get the same thing each time.

Windows Installer tooltip that comes up when running script

Dim objShell
Set objShell = Wscript.CreateObject ("Wscript.Shell")
objShell.Run "cmd /c msiexec" & "/i" & Chr(34) & "AppleApplicationSupport64.msi" & Chr(34) & "/quiet" & "/norestart"
objShell.Run "cmd /c msiexec" & "/i" & Chr(34) & "AppleMobileDeviceSupport6464.msi" & Chr(34) & "/quiet" & "/norestart"
objShell.Run "cmd /c msiexec" & "/i" & Chr(34) & "iTunes6464.msi" & Chr(34) & "/quiet" & "/norestart"
objShell.Run "cmd /c msiexec" & "/i" & Chr(34) & "Bonjour64.msi" & Chr(34) & "/quiet" & "/norestart"
objShell.Run "cmd /c msiexec" & "/i" & Chr(34) & "AppleSoftwareUpdate.msi" & Chr(34) & "/quiet" & "/norestart"
Set objShell = Nothing 

Second way I tried

Dim objShell
Set objShell = WScript.CreateObject( "WScript.Shell" )
objShell.Run("""%userprofile%\Desktop\Deployment\AppleApplicationSupport64.msi""") + "/quiet" + "/norestart"
objShell.Run("""%userprofile%\Desktop\Deployment\AppleMobileDeviceSupport6464.msi""") + "/quiet" + "/norestart"
objShell.Run("""%userprofile%\Desktop\Deployment\iTunes6464.msi""") + "/quiet" + "/norestart"
objShell.Run("""%userprofile%\Desktop\Deployment\Bonjour64.msi""") + "/quiet" + "/norestart"
objShell.Run("""%userprofile%\Desktop\Deployment\AppleSoftwareUpdate.msi""") + "/quiet" + "/norestart"
Set objShell = Nothing

It doesn't seem to go past the msiexec command. How can I get it to run the entire string together the full command to install the packages?

1
I think you need a space ( ) between the msi switches. - PatricK

1 Answers

1
votes

It looks like you are missing some spaces in your commands that you are sending to the shell. I'll just examine the first command as an example. Here's what you wrote:

objShell.Run "cmd /c msiexec" & "/i" & Chr(34) & "AppleApplicationSupport64.msi" & Chr(34) & "/quiet" & "/norestart"

And here is the command that that statement builds:

msiexec/i"AppleApplicationSupport64.msi"/quiet/norestart

You are getting that Windows Installer window because it doesn't understand the command with no spaces. Instead, add some spaces inside the string like so:

   objShell.Run "cmd /c msiexec " & "/i " & Chr(34) & "AppleApplicationSupport64.msi" & Chr(34) & " /quiet" & " /norestart"

The above will format the command as:

msiexec /i "AppleApplicationSupport64.msi" /quiet /norestart

That should resolve your issue.