/build/static/layout/Breadcrumb_cap_w.png

uninstall multiple versions of software

What is the command line syntax to uninstall multiple msi packages at the same time?

0 Comments   [ + ] Show comments

Answers (2)

Posted by: aogilmor 15 years ago
9th Degree Black Belt
0
msiexec /x {product code guid of previous version}
strictly speaking they won't be uninstalled at the same time but sequentially.
Posted by: SMSPMP 15 years ago
Yellow Belt
0
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 /7.1.3.100
' 929408E6-D265-4174-805F-81D1D914E2A4 /7.0.4
' C21D5524-A970-42FA-AC8A-59B8C7CDCA31 /7.1
' 55BF0E5F-EA8E-4C13-A8B4-9E4857F5A2DE /7.1.3.130
' 50D8FFDD-90CD-4859-841F-AA1961C7767A /7.1.3.170
' 5E863175-E85D-44A6-8968-82507D34AE7F /7.1.5.120

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", _
"5E863175-E85D-44A6-8968-82507D34AE7F")

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
Next
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
Else
RegKeyExists = False
End If
Set objReg = Nothing
End Function

Comments:
  • 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 - Kdebiasse 11 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ