Knowing how to uninstall a program using the command line is useful if you want to make a batch script to uninstall programs from multiple computers. You might also find it useful to uninstall programs via the command line if you are logged on as a user who doesn’t have permission to uninstall a program and you don’t want to log out then back in again as an administrator, only to have to log out and back in as the user afterwards. In this instance, you would run the command prompt as an administrator and then uninstall the program through the elevated command prompt.
There are a couple of different commands you can use to uninstall a program using the command line, the first option is with WMI. In the command prompt, type the following:
product get name
product where name=”<<name of program that you want to uninstall as shown in the list>>” call uninstall
The other method to uninstall a program from the command line is using the Windows Installer. To use the Windows Installer to uninstall a program, you need to know the programs GUID. You’ll have to Google that 😉 The command line command to uninstall a program using the Windows Installer is:
msiexec /x <<Program GUID>>
The advantage of this method is the additional command line switches that can be applied, such as /q REBOOT=ReallySuppress to hide the uninstall GUI from the user and prevent the computer from auto rebooting after the uninstall (good for batch files).