You can uninstall a program using Command Prompt by running the Windows Management Instrumentation command-line utility (WMIC) with the product uninstall command, or by using PowerShell's Uninstall-Package cmdlet. The most direct method is to open an elevated Command Prompt, type wmic product get name to list installed programs, then run wmic product where name="Exact Program Name" call uninstall. This works for traditional Windows Installer (MSI) packages, but not for every application.
Background: Why Use Command Prompt for Uninstalling?
Windows provides a graphical interface for removing programs through Settings > Apps or Control Panel > Programs and Features. However, there are situations where the command line is preferable or necessary. For example, if the graphical uninstaller is corrupted, if you need to automate removal across multiple machines, or if you are working on a Windows Server Core installation that lacks a full desktop environment. Command-line uninstallation also gives you more control and can be scripted.
The primary tool for this task is WMIC, which has been included in Windows since Windows XP and was deprecated in Windows 10 version 21H1 but remains available. Microsoft recommends using PowerShell cmdlets instead, but WMIC still functions in Windows 10 and 11 (though it may be removed in future versions). Another option is the built-in msiexec command for MSI packages, and PowerShell's Get-Package and Uninstall-Package cmdlets for a more modern approach.
How It Works: WMIC and the Uninstall Process
WMIC interacts with Windows Installer and other installation technologies through the Windows Management Instrumentation (WMI) interface. When you run wmic product get name, it queries the WMI class Win32_Product, which represents products installed using Windows Installer. This class only includes MSI-based installations; programs installed with other installers (like EXE-based installers, portable apps, or some third-party package managers) will not appear.
The call uninstall method on Win32_Product triggers the uninstallation process, which typically runs silently without user interaction. This is convenient for automation but means you won't see progress dialogs or prompts. The command returns a return value (0 for success) and may take several minutes to complete, especially for large programs.
For MSI packages, you can also use msiexec /x {ProductCode}, where the product code is a GUID. You can find product codes using wmic product get name, identifyingnumber. This method is more direct and avoids the overhead of WMI queries.
Step-by-Step: Uninstalling via Command Prompt
Follow these steps carefully. You must run Command Prompt as administrator to have the necessary permissions.
- Open Command Prompt as administrator: Press Windows key + X, then select "Command Prompt (Admin)" or "Windows PowerShell (Admin)" and type
cmd. Alternatively, search for "cmd" in the Start menu, right-click, and choose "Run as administrator". - List installed programs: Type
wmic product get nameand press Enter. This displays a list of installed MSI-based programs. Note the exact name of the program you want to remove. The list may take a moment to generate. - Uninstall the program: Type
wmic product where name="Exact Program Name" call uninstalland press Enter. ReplaceExact Program Namewith the name from the list, including spaces. For example:wmic product where name="Google Chrome" call uninstall. If the name contains special characters, you may need to escape them. - Confirm the uninstallation: WMIC will ask for confirmation if the
/nointeractiveflag is not used. TypeYand press Enter. The process may take several minutes. You'll see a message indicating success or failure.
If the program is not listed by WMIC, it may not be an MSI package. In that case, you can try using PowerShell: Get-Package -Name "Program Name" | Uninstall-Package. This works for some additional installers but not all. For programs installed via other means, you may need to use their own uninstaller executable, often found in the program's installation folder, or use third-party tools.
Common Problems and Limitations
WMIC's Win32_Product class has known limitations and issues. First, querying Win32_Product can trigger a consistency check on all installed MSI packages, which may cause reconfiguration of some applications and slow down the system. Microsoft has acknowledged this behavior. Second, it only covers MSI installations, which excludes many modern applications (e.g., those installed via EXE, Microsoft Store, or portable). Third, the uninstall method may not work if the program's uninstaller requires user interaction or has a corrupted registry entry.
Another common problem is that the program name must match exactly, including capitalization and spacing. If you're unsure, copy the name from the list. Also, running the command without administrator privileges will result in an "Access denied" error.
If WMIC fails, you can use msiexec /x with the product code. To find the product code, run wmic product get name, identifyingnumber. Then use msiexec /x {GUID}. This method is more reliable for MSI packages and doesn't trigger the consistency check.
Alternatives: PowerShell and Other Methods
PowerShell offers more modern and flexible cmdlets. You can use Get-Package to list installed packages (including some non-MSI ones) and Uninstall-Package to remove them. For example: Get-Package -Name "*Chrome*" | Uninstall-Package. However, Get-Package relies on the same underlying installer technologies and may not cover everything.
For programs installed via the Microsoft Store, you can use Get-AppxPackage and Remove-AppxPackage in PowerShell. For example: Get-AppxPackage -Name "*Calculator*" | Remove-AppxPackage.
Another alternative is to use the program's own uninstaller executable, often named uninstall.exe or unins000.exe, located in the program's installation folder. You can run it from Command Prompt by navigating to the folder and executing the file. This is often the most reliable method for non-MSI programs.
Safety and Precautions
Uninstalling programs via command line bypasses some of the safeguards of the graphical interface. Be certain you are removing the correct program; there is no undo. Always create a system restore point before making bulk changes or uninstalling critical software. Also, be aware that some uninstallers may leave behind residual files or registry entries. For thorough removal, you might need to manually delete leftover folders or use a dedicated uninstaller tool.
Do not use WMIC to uninstall system components or drivers unless you fully understand the consequences. Removing certain packages can break Windows functionality. Stick to user-installed applications.
Frequently Asked Questions
Can I uninstall any program using Command Prompt?
No. The WMIC method only works for programs installed using Windows Installer (MSI). Many programs use other installers (EXE-based) and won't appear in the wmic product list. For those, you need to use the program's own uninstaller or PowerShell cmdlets that support other package types.
Why does WMIC say "No Instance(s) Available" when I run the uninstall command?
This error means the program name you specified does not exactly match any MSI product. Check the spelling and spacing by running wmic product get name and copying the name precisely. Also ensure you are running Command Prompt as administrator.
Is it safe to use WMIC to uninstall programs?
Generally yes, for user-installed MSI programs. However, querying Win32_Product can trigger MSI reconfiguration and slow down the system. It's safer to use msiexec /x with the product code if you know it. Avoid uninstalling system components.
How do I uninstall a program that doesn't appear in the WMIC list?
Try PowerShell's Get-Package and Uninstall-Package. If that fails, look for an uninstaller executable in the program's installation folder (often in C:\Program Files\ProgramName) and run it from Command Prompt. For Store apps, use Get-AppxPackage and Remove-AppxPackage.
Can I uninstall multiple programs at once with Command Prompt?
Yes, you can write a batch script that runs multiple wmic product where name="..." call uninstall /nointeractive commands. The /nointeractive flag suppresses confirmation prompts. Be careful to test the script on a single machine first.
What is the difference between WMIC and msiexec for uninstalling?
WMIC uses WMI to query and uninstall MSI products, which can trigger consistency checks. msiexec directly invokes the Windows Installer service with a product code, which is faster and avoids the WMI overhead. Both require administrator rights.