What is the command line syntax to uninstall multiple msi packages at the same time?
0 Comments   [ - ] Hide Comments


Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
Answer this question or Comment on this question for clarity


msiexec /x {product code guid of previous version}
strictly speaking they won't be uninstalled at the same time but sequentially.
Answered 01/05/2009 by: aogilmor
Ninth Degree Black Belt

Please log in to comment
Here is a vbs script I use to remove multiple versions of Quicktime. I have also used this on many other applications such as Java too. All you need is the PID's of the applications you want to put into the Array. The script runs through the Array with the associated PID's and if it matches, uninstalls the app. I push this script out with SMS and have a very good success rate with it.

Call Main
Sub Main()
On Error Resume Next

Call RemoveQuicktime
End Sub

Sub RemoveQuicktime()
On Error Resume Next
Set oShell = WScript.CreateObject("WScript.Shell")

' F07B861C-72B9-40A4-8B1A-AAED4C06A7E8 /
' 929408E6-D265-4174-805F-81D1D914E2A4 /7.0.4
' C21D5524-A970-42FA-AC8A-59B8C7CDCA31 /7.1
' 55BF0E5F-EA8E-4C13-A8B4-9E4857F5A2DE /
' 50D8FFDD-90CD-4859-841F-AA1961C7767A /
' 5E863175-E85D-44A6-8968-82507D34AE7F /

Dim QTClassID
QTClassID = Array("F07B861C-72B9-40A4-8B1A-AAED4C06A7E8", _
"929408E6-D265-4174-805F-81D1D914E2A4", _
"C21D5524-A970-42FA-AC8A-59B8C7CDCA31", _
"55BF0E5F-EA8E-4C13-A8B4-9E4857F5A2DE", _
"50D8FFDD-90CD-4859-841F-AA1961C7767A", _

For Count = LBound(QTClassID) to UBound(QTClassID)
sKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{" & QTClassID(Count) & "}"
If RegKeyExists(sKeyPath) Then
sQTunInstall = "msiexec.exe /X{" & QTClassID(Count) & "} /qn REBOOT=ReallySuppress"
oShell.Run sQTunInstall,,True
End If
Set oShell = Nothing
End Sub
Function RegKeyExists(strRegKey)
Const HKLM = &H80000002
strRegKey = Trim(strRegKey)
Set objReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
If objReg.EnumValues(HKLM, strRegKey, aValueNames, aValueTypes) = 0 Then
RegKeyExists = True
RegKeyExists = False
End If
Set objReg = Nothing
End Function
Answered 01/07/2009 by: SMSPMP
Yellow Belt

  • How would you code
    "C:\Program Files\Google\Google Toolbar\Component\GoogleToolbarManager_F91D44FAA5479127.exe" /uninstall &
    regsvr32 /u /s "c:\program files\google\googletoolbar3.dll"
    into your script
Please log in to comment