Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there a way I can uninstall programs without the graphical interface and doing it via CMD?

share|improve this question

4 Answers 4

up vote 8 down vote accepted

Every program that properly installs itself according to Microsoft's guidelines makes a registry entry in HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall. Usually, the key for the program will be its GUID, or else the name of the program. Within that key will be an entry called UninstallString. This contains the command to execute to uninstall the program.

If you already know ahead of time what you will be uninstalling, it should be easy enough to just put that in your batch file. It gets tricky when you try to automate that process though. You can use the reg command to get data from the registry, but it returns a lot of text around the actual value of a given key, making it hard to use. You may want to experiment with using VBscript or PowerShell, as they have better options for getting data from the registry into a variable.

share|improve this answer

If a program uses Windows Installer, you can use one of the following commands:

msiexec /q /x <ProductCodeGuid>
msiexec /q /x <PathToMsi>

However, you're likely have neither the product code nor the original MSI file used for installation.

Other than that, there is no generic uninstall command, since installers that do not make use of Windows Installer are "unknown" by the operating system. They might supply their own uninstall executable, but whether that executable includes a way to run it without GUI depends on the individual software package.

share|improve this answer

If you know where the MSI installer file is you can use:

Msiexec /uninstall Application.msi /quiet

share|improve this answer

You can invoke the correct uninstaller without knowing the GUID etc. by using WMIC.

To see a list of the names of the programs as known internally by Windows:

wmic product get name

Look for your product name. It probably matches the one listed in the "Programs and Features" control panel, but not always.

Then you can use

wmic product where name="_my_product_name" call uninstall

to perform the uninstall, which AFAIK should be silent (has been in my experience, but try it before you bet the farm on that, silence may depend on how your installer/uninstaller was built).

See here for more:

There's also reference doc for wmic on Microsoft.com

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.