/build/static/layout/Breadcrumb_cap_w.png

uninstall Products in order

Hi,

I have to uninstall many products one after one and to respect an order. How can i do this en command line

 


3 Comments   [ + ] Show comments
  • What deployment tool are you using? You should take advantage of that instead of using a batch file. - rileyz 10 years ago
  • i'm using sccm to deploy my application - Asker 10 years ago
  • So build a Task Sequence. Although these were designed for OS deployment, they're ideal for this kind of thing. - anonymous_9363 10 years ago

Answers (2)

Answer Summary:
Posted by: terebent 10 years ago
Second Degree Brown Belt
1

Build a script and add the uninstallation command lines for each application in exact order you want.

Here is an example:

 Option Explicit

Dim strScriptPath : strScriptPath = Left(WScript.ScriptFullName, InStrRev(WScript.ScriptFullName, "\")-1)
Dim objWSH

Set objWSH = CreateObject("WScript.Shell")

if MSIInstalled("{31E11496-1F84-4DCC-B07A-369B40B8B4A7}") then
objWSH.Run "msiexec /x {31E11496-1F84-4DCC-B07A-369B40B8B4A7} /qn",,True
end if

'English
if MSIInstalled("{CCA40624-843E-48C6-B14F-E1070015D87C}") then
objWSH.Run "msiexec /x {CCA40624-843E-48C6-B14F-E1070015D87C} /qn",,True
end if


if MSIInstalled("{3186ACD0-B5C5-470E-ABE1-E4110C0A72BF}") then
objWSH.Run "msiexec /x {3186ACD0-B5C5-470E-ABE1-E4110C0A72BF} /qn",,True
end if

'Romanian
if MSIInstalled("{CCA40692-843E-48C6-B14F-E1070015D87C}") then
objWSH.Run "msiexec /x {CCA40692-843E-48C6-B14F-E1070015D87C} /qn",,True
end if

'French
if MSIInstalled("{CCA40628-843E-48C6-B14F-E1070015D87C}") then
objWSH.Run "msiexec /x {CCA40628-843E-48C6-B14F-E1070015D87C} /qn",,True
end if

'German
if MSIInstalled("{CCA40629-843E-48C6-B14F-E1070015D87C}") then
objWSH.Run "msiexec /x {CCA40629-843E-48C6-B14F-E1070015D87C} /qn",,True
end if

'Spanish
if MSIInstalled("{CCA40631-843E-48C6-B14F-E1070015D87C}") then
objWSH.Run "msiexec /x {CCA40631-843E-48C6-B14F-E1070015D87C} /qn",,True
end if

'Sweedish
if MSIInstalled("{CCA40637-843E-48C6-B14F-E1070015D87C}") then
objWSH.Run "msiexec /x {CCA40637-843E-48C6-B14F-E1070015D87C} /qn",,True
end if

'Hungarian
if MSIInstalled("{CCA40676-843E-48C6-B14F-E1070015D87C}") then
objWSH.Run "msiexec /x {CCA40676-843E-48C6-B14F-E1070015D87C} /qn",,True
end if

'Polish
if MSIInstalled("{CCA40678-843E-48C6-B14F-E1070015D87C}") then
objWSH.Run "msiexec /x {CCA40678-843E-48C6-B14F-E1070015D87C} /qn",,True
end if

'Japanese
if MSIInstalled("{CCA40630-843E-48C6-B14F-E1070015D87C}") then
objWSH.Run "msiexec /x {CCA40630-843E-48C6-B14F-E1070015D87C} /qn",,True
end if

'Italian
if MSIInstalled("{CCA40632-843E-48C6-B14F-E1070015D87C}") then
objWSH.Run "msiexec /x {CCA40632-843E-48C6-B14F-E1070015D87C} /qn",,True
end if

'Turkish
if MSIInstalled("{CCA40656-843E-48C6-B14F-E1070015D87C}") then
objWSH.Run "msiexec /x {CCA40656-843E-48C6-B14F-E1070015D87C} /qn",,True
end if

'Czech
if MSIInstalled("{CCA40675-843E-48C6-B14F-E1070015D87C}") then
objWSH.Run "msiexec /x {CCA40675-843E-48C6-B14F-E1070015D87C} /qn",,True
end if

'Russian
if MSIInstalled("{CCA40679-843E-48C6-B14F-E1070015D87C}") then
objWSH.Run "msiexec /x {CCA40679-843E-48C6-B14F-E1070015D87C} /qn",,True
end if

'Chinese (Traditional)
if MSIInstalled("{CCA40687-843E-48C6-B14F-E1070015D87C}") then
objWSH.Run "msiexec /x {CCA40687-843E-48C6-B14F-E1070015D87C} /qn",,True
end if

'Chinese (Simplified)
if MSIInstalled("{CCA40689-843E-48C6-B14F-E1070015D87C}") then
objWSH.Run "msiexec /x {CCA40689-843E-48C6-B14F-E1070015D87C} /qn",,True
end if

'Estonian (English)
if MSIInstalled("{CCA40602-843E-48C6-B14F-E1070015D87C}") then
objWSH.Run "msiexec /x {CCA40602-843E-48C6-B14F-E1070015D87C} /qn",,True
end if

'Dutch Netherlands
if MSIInstalled("{CCA40623-843E-48C6-B14F-E1070015D87C}") then
objWSH.Run "msiexec /x {CCA40623-843E-48C6-B14F-E1070015D87C} /qn",,True
end if



Function MSIInstalled(strProductCode)
Dim colList
Dim strItem
Dim objWI
Set objWI = CreateObject("WindowsInstaller.Installer")

For Each strItem In objWI.Products
If UCase(strProductCode) = UCase(strItem) Then
MSIInstalled = True
Exit Function
End If
Next
MSIInstalled = False
End Function

The script is verifing for each msi if is installed or not and if is installed them will uninstall it.


Comments:
  • Thanks for answers - Asker 10 years ago
Posted by: andrew_lubchansky 10 years ago
2nd Degree Black Belt
0

If you are using a K1000, you can use the Scripting module to build in logic into your tasks so that you can do them in order.  You can check out some KKEs on Scripting at our recordings page:

http://www.kace.com/support/resources/kb/article/kace-kontinuing-education-k1000-and-k2000-recordings

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
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