To uninstall programs using Command Prompt, we are going to use the Windows Instrumentation command-line interface (WMIC) in Windows.
Open a Command Prompt instance, type in
WMIC, and press Enter. Then to get the list of all installed programs enter this command:
product get name, version
This will populate a list of installed programs on your PC with its complete name and version number.
Note: WMI Product class will give you information only for software installed using MSI technology.
Just the name of the program is enough for uninstalling it, but I have added version number filter so that you don’t have to type in the lengthy names, like for instance, as seen in image, Microsoft Office. We can uninstall it with only its version. If you’d like to see all available information of a program just use this command:
If needed, you can also save the complete list of installed programs to an external file like this:
product get /format:csv > C:\your\path\programs.csv
Now, to uninstall a particular program, run this command:
product where name="your-program-name" call uninstall
To uninstall with its version run the command like this:
product where version="188.8.131.52" call uninstall
Above commands will prompt you before starting its process. For prompt-less execution or silent uninstall, add the
product where name="your-program-name" call uninstall /nointeractive
On successful uninstall you will get
RetrunValue = 0;:
Bonus: To get a list of installed hotfix (QFE – Quick Fix Engineering) updates in WMIC, use this:
These command works on Windows 8, Windows 7, Windows Vista, Windows XP Professional, and Server editions.