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
    [code]HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall[/code]
  • 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”

[code]wmic
product where caption=’Microsoft Silverlight'[/code]

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.

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

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)

[code]wmic
product where caption=’Microsoft Silverlight’ call uninstall[/code]

Your feedback is welcome.
Ivan

7 thoughts on “How to uninstall application (Silverlight in this instance) using a command prompt”

  1. Ivan, I am running this from an elevated command prompt.

    wmic (enter)
    product where caption=’Microsoft Silverlight’ (enter)

    Nothing happens, just a flashing cursor.
    HELP!

    Reply
    • Hi Cynthia,
      I have ran the command myself and i get the following on my machine:
      https://ivan.dretvic.com/screenshots/2019-02-19_095325.png

      You can see the response was ‘No Instance(s) Available.
      This to try:
      – try it on multiple computers and see if you get the same result
      – manually type it in, especially with regards to the quotes as they can be converted to different characters
      – Type in WMIC >> ENTER >> Product >> ENTER. This should produce all the products in you system, and prove WMIC is working.
      This is what mine looks like:
      https://ivan.dretvic.com/screenshots/2019-02-19_095649.png
      If that fails, you have an issue with WMI and should rebuilt WMI. There are multiple different suggestions on how to rebuild WMI. Follow several until it works. Maybe even i wrote an article on that, but i cant remember.
      – try running in a non elevated prompt. Note you cant uninstall but you can still query WMI.

      Hope that helps,
      ivan

      Reply
      • I see now that the issue was due to the offending desktop did not have silverlight installed.

        When using your method, I receive the following message:
        msiexec – Alias not found.

        I was able to successfully use Janson Chung’s method on other desktops running silverlight, which I thank you for listing here.

        Reply

Leave a Reply to dsadsaCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

QR Code Business Card