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 ?

Answer from awsayad on community.spiceworks.com
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 - ... If the app was installed using Winget, you can remove it quickly with a simple command. Right-click the Start button → Command Prompt (Admin). ... If Chocolatey was used to install programs, it can also remove them.
Discussions

Uninstall software remotely using the command line - Software & Applications - Spiceworks Community
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 ... More on community.spiceworks.com
🌐 community.spiceworks.com
26
February 11, 2019
Windows 10: How can you uninstall a program when the command prompt is blocked?
Check the PowerPDF support site (if any) and see if there's a command to uninstall from the CLI. It might require using MSIEXEC or knowing the registry entry which identifies the program. But if it can be uninstalled in such a manner, run the command prompt with Admin privileges, then execute the required command. A quick google search found this: https://nuance.custhelp.com/app/answers/detail/a_id/27831/~/how-to-do-a-silent-uninstall-of-power-pdf%3F YMMV More on reddit.com
🌐 r/sysadmin
9
0
May 7, 2023
batch file - Is there any Windows command to uninstall an application? - Stack Overflow
I want to write a batch file in which I need to uninstall some applications from my Windows 7 machine. More on stackoverflow.com
🌐 stackoverflow.com
Script to uninstall program
If you are on Windows 10 or later, please try this first. Who know, you might get lucky. winget uninstall "Axon Agent" It works from both Command Prompt and PowerShell, if you have the Desktop App Installer not uninstalled. A second trick is to open the legacy PowerShell 5.1 (not PowerShell 6 or later) and run this command: Uninstall-Package -Name 'Package name' In the case you don't know the 'Package name', get it from here: Get-Package | Sort-Object -Property Name In PowerShell, the equivalent of wmic is Invoke-CimInstance. I'm afraid I cannot give you any tips on how to use it, because I'm opposed to using the win32_product class. Here is why: https://sdmsoftware.com/wmi/why-win32_product-is-bad-news/ If none of the above worked, you can call msiexec.exe /uninstall. You can extract the needed parameter from the Windows Registry. More on reddit.com
🌐 r/PowerShell
11
0
August 27, 2024
🌐
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 - Open the run box (windows key + r) and type runas /user:DOMAINADMIN cmd. You will be prompted for the domain administrator password. Type said password and press enter. Once the elevated command prompt appears, type control appwiz.cpl to open the Add/Remove Programs control panel.
🌐
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 ...
🌐
MakeUseOf
makeuseof.com › home › windows › 11 different ways to uninstall software in windows 11
11 Different Ways to Uninstall Software in Windows 11
November 2, 2023 - If you prefer command-line methods, you can uninstall software with Command Prompt’s WMIC tool as follows. Click the search button (magnifying glass icon) on Windows 11’s taskbar button. Enter Command Prompt to find that app. Select the Run as administrator option for the Command Prompt search result.
🌐
MiniTool
minitool.com › home › news › how to uninstall program using cmd/powershell windows 10/11
How to Uninstall Program Using CMD/PowerShell Windows 10/11 - MiniTool
September 28, 2025 - You can also right-click on the title bar of PowerShell utility and select Edit -> Find, type a part of the app name and click Find Next until you find the target app. Step 3. Next, type the command Remove-AppxPackage <App Name>, e.g.
Find elsewhere
🌐
Microsoft Learn
learn.microsoft.com › en-us › windows › package-manager › winget › uninstall
uninstall Command | Microsoft Learn
To avoid Microsoft Store agreement prompts when uninstalling, you can add the --source winget WinGet flag to the winget uninstall command. Alternatively, you can uninstall using Start > Settings > Apps > Apps & features, finding the app you ...
🌐
Reddit
reddit.com › r/sysadmin › windows 10: how can you uninstall a program when the command prompt is blocked?
r/sysadmin on Reddit: Windows 10: How can you uninstall a program when the command prompt is blocked?
May 7, 2023 -

On one of my client PCs, I had something called PowerPDF installed. I opened up my command prompt as Administrator, typed in appwiz.cpl to open up the Programs list. I then selected PowerPDF, then Uninstall/Change. At that moment, a command prompt window popped up telling me that access is denied.

A bit about our setup with respect to the issue...

Command prompt can be searched for in the Windows search bar. It will also display the opens Open, Run as Administrator nd Open File Location. If a user clicks 'Open', the command prompt will run, but show an access denied message. If 'Run as Administrator' is selected, the user is prompted for a Username and Password, which must be the Admin user.

I'm going to guess what's going on, is that the Uninstall script of the app is just attempting to run Command Prompt without Administrative Privileges, thus the uninstaller is getting blocked. How it got installed in the first place is beyond me.

Anyways, how can I uninstall an app with this problem?

🌐
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 - Step 4. Type wmic product where name="Program Name" call uninstall and press Enter. Typically, unwanted programs are uninstalled using the Add or Remove Programs utility or the Settings app in Windows.
🌐
Computer Hope
computerhope.com › issues › ch002272.htm
How to Uninstall a Program Using Command Prompt.
September 7, 2025 - ... You can also right-click the Command Prompt program in the search results and select Run as administrator in the pop-up menu. In an elevated Command Prompt, type wmic and press Enter. You'll see a line that reads wmic:root/cli>.
🌐
Dell
dell.com › support › kbdoc › en-us › 000137586 › windows-10-various-methods-to-uninstall-problematic-programs-and-apps
How To Remove Applications, Programs, and Updates in Windows 11, and Windows 10 | Dell US
However, this does remove any other programs that are installed in that same period. You can find out more on the following link: ... You can right-click the App icon in the Start Menu and select uninstall. However, if this is not available or does not work, you can also use Command Prompt or PowerShell which are Command-Line Interfaces (CLI).
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.

🌐
Geek Rewind
geekrewind.com › home › windows › uninstall programs in windows 11 via command prompt
Uninstall Programs in Windows 11 via Command Prompt - Geek Rewind
May 6, 2025 - This article explains how to uninstall or remove programs from Windows 11 using the command prompt. Windows allows users to uninstall programs using the Control…
🌐
Windows Command Line
windows-commandline.com › run-command-for-add-or-remove-programs
Run command for add or remove programs
September 21, 2016 - Using Add or remove programs wizard we can install new features of the Windows(which are not installed by default) and also uninstall programs that are no longer needed. We can open this wizard from Run window by running the command appwiz.cpl
🌐
MiniTool Partition Wizard
partitionwizard.com › home › partition magic › top 7 effective ways to uninstall programs/apps on windows 11
Top 7 Effective Ways to Uninstall Programs/Apps on Windows 11 - MiniTool Partition Wizard
July 11, 2023 - For that, you also need to uninstall programs. Here comes the question – how to uninstall apps on Windows 11. In this post, we illustrate how to remove programs on Windows 11 via Start Menu, Settings, Control Panel, CMD, PowerShell, Registry Editor, third-party uninstallers.
🌐
Pureinfotech
pureinfotech.com › home › how to uninstall apps on windows 11
How to uninstall apps on Windows 11 - Pureinfotech
January 19, 2026 - Alternatively, you can use the “winget uninstall –id APP-ID” command with Command Prompt or the “Get-AppxPackage PROGRAM-NAME | Remove-AppxPackage” command on PowerShell, among other options.
🌐
MajorGeeks
majorgeeks.com › content › page › uninstall_command_prompt.html
How to Uninstall Programs With PowerShell or Command Prompt in Windows 10 & 11 - MajorGeeks
June 28, 2021 - Type in wmic and press Enter. Next, let's get a list of installed programs by typing in product get name, and press Enter. The list might take a minute to appear. To uninstall the program, use the following code replacing PROGRAM NAME with the ...