To uninstall a program installed via an EXE file using Command Prompt, you typically use the program's uninstall string stored in the Windows registry. This method works for most standard Windows installers (MSI or NSIS-based EXEs) and gives you precise control when the program’s uninstaller is missing or unresponsive. You’ll need administrative rights on the PC and access to the registry key where the uninstall information is stored.

What You'll Need

  • A Windows PC (Windows 10 or 11 recommended)
  • Administrative privileges on the computer
  • Command Prompt running as Administrator
  • The exact name of the installed program (to help locate its registry entry)

Step-by-Step

  1. Open Command Prompt as Administrator: Press Windows + S, type cmd, right-click Command Prompt (or Windows Terminal if you use it), and select Run as administrator. Confirm any User Account Control prompt.
  2. Generate a list of installed programs using PowerShell: In the Command Prompt window, type powershell -Command "Get-MpComputerStatus | Select-Object -Property DisplayName, Version, ProductState" — but this is not the right command. Instead, to list installed software reliably, use: powershell -Command "Get-Package | Where-Object { $_.ProviderName -eq 'msi' -or $_.ProviderName -eq 'Programs' } | Select-Object Name, Version, ProviderName". This shows installed packages with their names and versions. Note the exact Name of the program you want to uninstall (e.g., 7-Zip 22.01 (x64)), including spaces and punctuation.
  3. Retrieve the uninstall string from the registry: Run the following command, replacing ProgramName with the exact name you noted (use quotes if there are spaces): reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" /s /f "ProgramName" /e. For 64-bit programs on 64-bit Windows, also check the 32-bit registry view by running: reg query "HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall" /s /f "ProgramName" /e. Look for a key that has a UninstallString value containing a path to an EXE or MSI command (e.g., C:\Program Files\Example\uninstall.exe or MsiExec.exe /I{GUID}).
  4. Copy the full uninstall string: Once you find the correct registry key (look for a long GUID-like name such as {12345678-1234-1234-1234-123456789ABC}), copy the entire value of the UninstallString entry. This will usually be in the format MsiExec.exe /X{GUID} or "C:\Path\Uninstall.exe".
  5. Run the uninstall command: Paste the copied uninstall string directly into the Command Prompt and press Enter. If it includes a GUID, it will typically start with MsiExec.exe /X — this is safe to run. If it’s an EXE path, make sure the path is correct and the file exists (some uninstallers are embedded in the original installer).
  6. Confirm uninstallation: A prompt may appear asking for confirmation. Follow the on-screen instructions to complete removal. Wait for the process to finish, and check Settings > Apps > Installed apps to verify the program is gone.

Common Mistakes

  • Running Command Prompt without administrative rights — this will cause registry queries and uninstall commands to fail or return empty results.
  • Using an approximate program name — typos, missing spaces, or incorrect capitalization in the /f filter can cause the registry search to miss the entry entirely.
  • Running the wrong uninstall string — some programs have multiple entries (e.g., main program + updater). Double-check the DisplayName value under each registry key before running the command.
  • Forgetting to include quotes around paths with spaces — if the uninstaller path is C:\Program Files\App\uninst.exe, it must be run as "C:\Program Files\App\uninst.exe" or it will fail with a path error.
  • Assuming all EXEs uninstall via MsiExec — only MSI-based installers use this. NSIS or InnoSetup EXEs often require running the EXE uninstaller directly.

Tips

  • For faster registry searches, paste the full uninstall key path once you find it (e.g., HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{ABC123}) and run reg query "[path]" /v UninstallString to confirm the exact command.
  • Use PowerShell for a more user-friendly list: Get-Package | Format-Table Name, Version, ProviderName -AutoSize gives a clean table view with all installed software, including EXE-based installers that register with Windows Installer.
  • Save the uninstall string in a text file as a backup — some programs overwrite or delete the uninstall entry during updates.
  • If the program has a silent uninstall flag (e.g., /S or /silent), you can append it to the command for automated removal (e.g., "C:\App\uninstall.exe" /S), but test this first in a non-critical environment.
  • For programs installed with an MSI (e.g., many enterprise tools), the uninstall string will always be MsiExec.exe /X{GUID} — this is the most reliable method and avoids third-party tools.

Troubleshooting

If the program doesn’t uninstall or the command fails, follow these steps:

  1. Verify administrative rights: Reopen Command Prompt, right-click > Run as administrator, and try the uninstall command again.
  2. Confirm the uninstaller file exists: Navigate to the path in File Explorer. If the EXE or MSI is missing (e.g., deleted manually), the uninstall command won’t work. In this case, download the original installer from the vendor’s site — many installers include a repair or uninstall option when re-run.
  3. Check for multiple registry entries: Some programs leave behind orphaned uninstall keys (e.g., after a failed update). Use the registry editor (regedit) to manually inspect both Uninstall and WOW6432Node\Uninstall paths for entries matching the program name.
  4. Use Windows’ built-in uninstaller as fallback: If Command Prompt fails, go to Settings > Apps > Installed apps, search for the program, click the three dots, and select Uninstall. This uses the same registry data but with a GUI wrapper.
  5. Check for third-party uninstallers blocking removal: Antivirus or system utilities (e.g., CCleaner, Revo Uninstaller) may lock files. Temporarily disable real-time protection and retry the uninstall.
  6. Handle hanging processes: If the uninstaller starts but hangs, open Task Manager (Ctrl+Shift+Esc), end any related processes (e.g., uninstall.exe or MsiExec.exe), then reboot and try again.

Frequently Asked Questions

Can I uninstall any EXE program using Command Prompt?

Most EXEs registered with Windows (including those installed via MSI or modern EXE wrappers) can be uninstalled this way. However, portable EXEs (e.g., single-file tools that don’t install) won’t appear in the registry and must be removed manually by deleting the EXE and associated folders.

Do I need to reboot after uninstalling?

Sometimes — especially if files are in use during uninstallation. Windows may schedule file deletion for the next restart. If the program still appears in Settings or the Start menu after uninstalling, reboot once and check again.

Why does the uninstall command ask for the original installer?

This happens when the uninstall process needs to repair or modify the installation before removing it (common with MSI packages). Providing the original installer file (or re-downloading it) resolves this. You don’t need to reinstall; just let the repair/uninstall proceed.

Can I force uninstall a program with Command Prompt?

Not safely. There’s no official force uninstall command. Manually deleting registry keys or files risks leaving orphaned data or breaking dependencies. Always try the standard uninstall first, then use Windows’ built-in troubleshooter or vendor-provided cleanup tools.

Is it safe to delete registry keys manually to remove an uninstall entry?

Only if you’re certain the program is fully uninstalled and the entry is orphaned. Back up the registry first (File > Export in regedit). Never delete keys under HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall unless you’ve confirmed the program is gone and the entry has no DisplayName or is clearly malformed.

Does this method work on Windows 7 or 8?

Yes — the registry structure and uninstall commands are nearly identical on Windows 7, 8, 10, and 11. The main difference is the uninstall path in Settings (Control Panel > Programs and Features on older systems), but the Command Prompt method remains unchanged.