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.

Answer from nhinkle on Stack Exchange
🌐
Medium
medium.com › @andrew.perfiliev › how-to-uninstall-program-using-cmd-60911c0eee80
How to uninstall program using CMD | by Andrew Perfiliev | Medium
September 8, 2019 - How to uninstall program using CMD 1. You need to open CMD. Win button ->type CMD->enter 2. type in wmic 3. Type in product get name and press Enter. This will show all of the programs that are …
Top answer
1 of 8
21

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.

2 of 8
32

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 (it 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:

  • WMIC: the best command line tool you've never used (overview of WMIC with lots of cool commands described)
  • Windows: Uninstall an Application from the Command Line (the specific recipe)

There's also reference documentation for WMIC on microsoft.com.

🌐
Seven Forums
sevenforums.com › tutorials › 272460-programs-uninstall-using-command-prompt-windows.html
Programs - Uninstall using Command Prompt in Windows - Windows 7 Help Forums
January 6, 2013 - This tutorial will show you how to uninstall programs using a command prompt in XP, Vista, Windows 7, and Windows 8.
Top answer
1 of 13
12

I need to use a script with either CMD or Power Shell to uninstall a program from a windows machine.

To be clear , I already know how to use the “wmic” & "Get-WmiObject -Class Win32_Product ", what I am looking for is how to remove the programs listed under Programs & Feature in control panel but doesn’t show up when using WMIC (Product Get Name) or (Get-WmiObject -Class Win32_Product) commands.

I can use these script easily:

1. CMD:

wmic

product get name

product where name=“program name” call uninstall

2. Power Shell:

$app = Get-WmiObject -Class Win32_Product | Where-Object { $_.Name -match “Software Name” } >> $app.Uninstall()

Both scripts above helped me remove specific programs only, but the list I have under control panel still have lots of other applications that I am hoping to use similar script to remove them.

Any idea / suggestion is highly appreciated ?

2 of 13
3

If the application was installed by MSI, and if you know the GUID, you can use msiexec to uninstall the application. That is the most efficient way, provided that the prerequisites are true.

Win32_Product is very inefficient.

Scripting Blog [archived] – 13 Nov 11

Use PowerShell to Quickly Find Installed Software - Scripting Blog [archived]

Summary: Learn how to use Windows PowerShell to quickly find installed software on local and remote computers.   Microsoft Scripting Guy Ed Wilson here. Guest Blogger Weekend concludes with Marc Carter. The Scripting Wife and I were lucky enough...

Scripting Blog [archived] – 14 Dec 11

Use PowerShell to Find and Uninstall Software - Scripting Blog [archived]

Summary: Learn how to use Windows PowerShell to get software installation locations, and to uninstall software from remote computers. Hey, Scripting Guy! We have a dumb application that we have to use at work. The company has released a new version...

🌐
GeeksforGeeks
geeksforgeeks.org › techtips › how-to-uninstall-software-via-cmd
How to Uninstall Software via CMD: Top 3 Methods - GeeksforGeeks
December 5, 2025 - Uninstalling programs through Command Prompt (CMD) can be extremely useful especially when the Settings app won’t open, the program won’t uninstall normally, or you need an automated/scripted solution. This guide explains the simplest CMD-based methods to remove software from Windows 10 and 11.
🌐
Spiceworks
community.spiceworks.com › software & applications
Uninstall software remotely using the command line - Software & Applications - Spiceworks Community
February 11, 2019 - In this manual, I will show how you can uninstall software remotely from your computer using the command line (and not delete files, but uninstall the program), without going into the control panel and running the Programs and Features applet. I do not know how much this will be useful to most ...
🌐
Computer Hope
computerhope.com › issues › ch002272.htm
How to Uninstall a Program Using Command Prompt.
September 7, 2025 - Use the following syntax to uninstall the program, replacing the asterisks with the proper name from the list generated above: ... When prompted, press the Y key to confirm and press Enter. After a few seconds, you will see Method execution successful, confirming that the program was removed. How to uninstall software in Windows.
Find elsewhere
🌐
Webroot
answers.webroot.com › Webroot › ukp.aspx
Appwiz.cpl explanation
Appwiz.cpl is a run command shortcut to open the Add/Remove Programs or Uninstall a Program list on Microsoft Windows XP, Vista, 7, 8, and 10. To use the appwiz.cpl command on your computer, press the Windows Key ( ) + R on your keyboard at the same time. The Run Command window should come up.
🌐
Virtually Impossible
virtuallyimpossible.co.uk › using-an-elevated-command-prompt-to-open-add-remove-programs
Using an elevated command prompt to open Add Remove Programs - Virtually Impossible
May 30, 2012 - You’ve noticed there is software ... can only be uninstalled by a user with administrative privileges”. Smeg! Open the run box (windows key + r) and type runas /user:DOMAINADMIN cmd....
🌐
Techwalla
techwalla.com › tech support › how to
How to Uninstall Software Using a Command Prompt | Techwalla
February 9, 2017 - If you cannot access the Control Panel or prefer a faster way of uninstalling a program, you can use the Command Prompt instead. ... Click "Start," select "Run," type "cmd" and hit "Enter."
🌐
Blogger
nileshsapariya.blogspot.com › 2017 › 05 › how-to-uninstall-program-using-command.html
How to uninstall program using command prompt (cmd)
So lets start Step 1: Open you command prompt To open cmd: click on Start -> Run --> type cmd and hit enter · Step 2: In windows to go to c drive we type cd.. as shown below · Step 3: Now we have to go in system 32 directory so the command ...
Top answer
1 of 3
2

Hi IIIGeneralII

This problem has been solved by me, i just forgot that the support ticket is still active :b

You can uninstall the program by breaking it, simply use the following command in the recovery cmd

cd C:

Note: depending on which drive you install windows on, it might be D: or something else

cd Program Files

After that use dir to locate the avast file

If you didn’t find it use cd program files (x86) instead

Note its important to check on ehich folder did avast install on

Search on the internet and find out

After that

del avast

It will say “are you sure? (Y/N)?”

Type y and enter

Use cd avast to make sure that all files are deleted

Then use dir

If not all of them are deleted

Use del (something like avast.exe and etc) on all of the files.

Restart your PC/laptop and boot into it

For driver issues and boot looping

Check other topics on them

2 of 3
1

system restore does not work in my case and when trying to use wmic, product returns an invalid class error. Neither of these are a solution for me.

The issue is trying to download avast, the driver files were corrupted causing the BSOD. It is now in a boot loop and the repair nor the system restore will work. They return errors. Checking the logs, they point back to AVAST files. Now I am trying to just remove AVAST since this all happened when I started to download it and the corrupted files all seem to be due to AVAST. I figured the easiest thing should have been to uninstall via the CMD, but wmic does not work as when I type product or product get name, it returns

Node - MININT-JBIHR0D

ERROR:

Description - Invalid class

🌐
Up & Running Inc
urtech.ca › 2019 › 09 › solved-command-line-to-uninstall-software-exes-or-msis
SOLVED: Command Line To Uninstall Software EXE's or .MSI's - Up & Running Inc - Tech How To's
February 21, 2023 - Figure out what the GUID of the ... Either in a CMD window running as an ADMIN or a script running as an ADMIN msiexec /quiet /norestart /uninstall {<GUID>} like: msiexec /quiet /norestart /uninstall {7FCA6452-46F2-452F-A5A7...
🌐
EaseUS
easeus.com › pc transfer › how to uninstall a program using cmd [step by step]
Uninstall a Program Using Command Prompt in Windows 11/10
January 29, 2026 - While CMD is primarily for uninstalling programs, you can delete a single file using the following steps with caution (deleted files cannot be recovered): Open Command Prompt as administrator (search for "cmd" and right-click "Run as administrator").
Top answer
1 of 6
32

You can get some clues as to where an application lives, by looking at where it's uninstaller is located.

Windows stores the list of uninstaller locations in the registry. You can use Regedit to go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall.

That registry key contains a whole lot of sub-keys with GUID names (big long strings of seemingly random letters and numbers). Use Regedit's search function and set it to look for the name of your program as it appears in the "programs and features" list of installed programs. (Un-tick keys and values and just leave data ticked).

Once you find the right sub-key, you'll see a bunch of values for your program. One of them will be called "UninstallString" and may point to the executable or DLL that is used to uninstall the software (or might pass a file location as a parameter to MSIexec or RunDLL). Depending on where the application's uninstaller lives, that information might give you the clue you need to find the rest of the application.

There are other bits of information in the registry that can help you too - See more info from Microsoft at https://msdn.microsoft.com/en-us/library/aa372105(v=vs.85).aspx

Typically programs that don't list an install location will have installed themselves in a number of places around your disk though, so it's best to use the uninstaller if you can.

2 of 6
17

Go to control panel --> Right click on the Control panel grid header --> Select More --> and check the location option.

Now the program location shows up in the control panel.

🌐
GreenCloud
green.cloud › home › greencloud documents › windows operating systems › how to force a program to uninstall on windows
How to force a program to uninstall on Windows - GreenCloud Documentation
January 19, 2026 - To uninstall a program or app via Command Prompt, you’ll first need to run Command Prompt as an administrator · Step 1: In the Windows Search box, select the Command Prompt app. Right-click it, then click Run as administrator. Command Prompt will open with administrator permissions