How to uninstall application (Silverlight in this instance) using a command prompt

Normally when I want to uninstall an application I will work through the below steps to get a simple clean uninstall script that is recommended. Unfortunately sometimes vendors dont provide this and you need to get creative in how you uninstall certain applications.

Here are the following steps I initially use to get more info on the steps:

  • Documentation – check to see if the vendor has written uninstallation documentation – most mainstream applications have detailed instructions on uninstallation of products
  • Check the registry for installed programs and see if they have an uninstall parameter
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
  • Lastly, google to see if others have found the answer already
  • WMI query – new step for me as the above did not help me for Silverlight

Silverlight…

So I went to all the above mentioned and found that its not that obvious to uninstall Silverlight. The product documentation I found did state that you can run Silverlight.exe /qu to do a quiet uninstall, however it will only do it for that exact version.

Further looking into the Registry key for uninstallers i was not able to find an appropriate uninstall GUID or location. Finally I found the answer after interrogating WMI.

To get information about the product run the following command on a machine with an elevated command prompt”

wmic
product where caption='Microsoft Silverlight'

And the final output is the below for Silverlight 4 and Silverlight 5 (after some formatting):

Detail Silverlight 4 Silverlight 5
AssignmentType 1 1
Caption Microsoft Silverlight Microsoft Silverlight
Description Microsoft Silverlight Microsoft Silverlight
HelpLink http://go.microsoft.com/fwlink/?LinkID=91955 http://go.microsoft.com/fwlink/?LinkID=91955
HelpTelephone
IdentifyingNumber {89F4137D-6C26-4A84-BDB8-2E5A4BB71E00} {89F4137D-6C26-4A84-BDB8-2E5A4BB71E00}
InstallDate 20120905 20120515
InstallDate2
InstallLocation c:\Program Files (x86)\Microsoft Silverlight\ C:\Program Files\Microsoft Silverlight\
InstallSource c:\c7d1cee414276eaf4a1cf03e4cef3e1b\ d:\35d7bf033e30a5bde26148c88cb4\
InstallState 5 5
Language 1033 1033
LocalPackage c:\Windows\Installer\80cf9afa.msi C:\Windows\Installer\18f86f05.msi
Name Microsoft Silverlight Microsoft Silverlight
PackageCache c:\Windows\Installer\80cf9afa.msi C:\Windows\Installer\18f86f05.msi
PackageCode {5A21A75B-58D7-4236-928F-ADD178C14697} {B946E19A-528E-4FAC-9C89-04027CC06FC4}
PackageName silverlight.msi silverlight.msi
ProductID
RegCompany
RegOwner
SKUNumber
Transforms
URLInfoAbout
URLUpdateInfo
Vendor Microsoft Corporation Microsoft Corporation
Version 4.0.50524.0 5.1.10411.0
WordCount 0 0

The uninstall command

This gave me all the information I needed. Now I simply run the following command and it will uninstall Silverlight silently using the now discovered IdentifyingNumber.

msiexec /x {89F4137D-6C26-4A84-BDB8-2E5A4BB71E00} /qn

Alternatively I could have used the following command to uninstall via WMIC but I am not a big fan of that solution. Source (Jansonchun.hubpages.com)

wmic
product where caption='Microsoft Silverlight' call uninstall

Your feedback is welcome.
Ivan

  1. Thanks, it Works.

  2. Thanks so much, it really works!!!

Leave a Reply

QR Code Business Card
%d bloggers like this: