Infrastructure

Uninstall Multiple Versions of an Application with One Script

I recently ran into a situation where I needed to uninstall Microsoft Office Live Meeting 2007 through SCCM. Normally this would not be an issue, but the environment I was working had multiple versions installed. Therefore I was unable to run the msiexec /x {product code} command, because each version had it own product code.

This left me with a couple of options.  I could make a separate uninstall for each version. This would be very cumbersome and require being able to determine the product code for every potentially installed version. Or I could write a VBScript that would find the installed version and perform the uninstall. I choose to create the VBScript.

Even though each version has its own product code, they all contain the same upgrade code. So, using the upgrade code I was able to write a script that will query the Win32_Property class and return the product code based on the upgrade code. The script will then execute the msiexec /x {product code} command to perform the uninstall.

I have tested this with four different versions and it worked for each of them. The good thing about this, is you can use this for pretty much any product that uses the upgrade code in the install MSI. You will just need to change the upgrade code in line 13.

 

This script can easily be changed to add logging and additional error checking as needed.

2 Comments

  1. Prakash Kumar December 24, 2012
  2. Tom January 18, 2016

Leave a Reply

x

We use cookies to ensure the best possible experience on our website. Detailed information on the use of cookies on this site is provided in our Privacy and Cookie Policy. Further instruction on how to disable our cookies can be found there.