To remove APPX packages, Remove-AppxPackage is the best and only one reliable command. Another way is to remove/delete the installed files of that app. Remember this procedure does not (and never will) truly uninstall that APPX package.

At first, find folders containing the APPX name (e.g. for "Weather" it will be "Microsoft.BingWeather") in the following directories:

C:\Program Files\WindowsApps\
C:\Users\<user_name>\AppData\Local\Packages\
C:\Windows\InfusedApps\Applications\
C:\Windows\InfusedApps\Packages\

Then make a batch file with the following commands and run it as administrator. Then enter the folders full path containing the appx name. Be cautious when you enter folder path, it should have the Appx name at last.

@echo off
set /p X=Enter Directory path: 
takeown /F %%X /R /D Y
icacls %%X /grant Everyone:F /T
rd /S /Q %%X
pause

Further reading:

  • takeown command
  • icacls command
  • Microsoft Answer: WindowsApps folder
Answer from Biswapriyo on Stack Exchange
🌐
Microsoft Learn
learn.microsoft.com › en-us › windows › package-manager › winget › uninstall
uninstall Command | Microsoft Learn
To avoid Microsoft Store agreement ... Alternatively, you can uninstall using Start > Settings > Apps > Apps & features, finding the app you want to remove, and selecting More > Uninstall....
Discussions

Using Terminal to Fully Delete Applications
just remove your apps with the appcleaner app, and for the apps that u already deleted reinstall and remove again with appcleaner and it will remove all the related files of it. More on reddit.com
🌐 r/MacOS
8
3
June 11, 2023
windows - Uninstall and Install App on my Computer silently - Stack Overflow
I am looking for a script or some cmd command to uninstall any app from my computer. I am using Windows OS. Being an automation analyst I have to constantly run automated tests for different products More on stackoverflow.com
🌐 stackoverflow.com
how to uninstall a program using CMD or Power Shell ?
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 ... More on community.spiceworks.com
🌐 community.spiceworks.com
13
12
February 28, 2019
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
🌐
Apple Community
discussions.apple.com › thread › 2449492
Removing/Uninstalling an application by Terminal
June 11, 2010 - If you know where the item is located through the Finder or on the Desktop, then drag the item into the Terminal window immediately after "rm -rf ". Note there must be a space after "-rf". ... Hi Thanks for the reply ! Actually, I know all of those commands, what i need to know exactly is : ...
🌐
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.
🌐
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 - Sometimes it might differ from Programs and Features​ installed programs. 4. Example of the command listed under this. (To be prompted Y/N to approve. Recommended) product where name=”name of program” call uninstall (To NOT be prompted Y/N to approve.) product where name=”name of program” call uninstall /nointeractive · 5. After this, you should see successful uninstallation of the program · Cmd · Windows ·
🌐
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.
🌐
How-To Geek
howtogeek.com › home › windows › how to uninstall a program on windows 10 from command prompt
How to Uninstall a Program on Windows 10 from Command Prompt
August 31, 2023 - Command Prompt will now launch with administrator permissions. To uninstall a program using Command Prompt, you have to use the Windows Management Instrumentation Command-line (WMIC) software utility.
Find elsewhere
🌐
Reddit
reddit.com › r/macos › using terminal to fully delete applications
r/MacOS on Reddit: Using Terminal to Fully Delete Applications
June 11, 2023 -

Hey guys, I was wondering if there was a way to remove an app fully with Terminal? Whenever I try to remove app and reinstall it with a new version with terminal it's the same old version but a higher size. Can anyone tell me what I am possibly doing wrong?

🌐
Revo Uninstaller
revouninstaller.com › home › logs preview – en
Uninstall Terminals with Revo Uninstaller
September 29, 2025 - ... In the Search field type "Terminals" and you will see all logs of "Terminals" in the database compatible with your Windows Version. ... Select the appropriate log by version from the list and press the "Uninstall" button from the toolbar
🌐
Digital Citizen
digitalcitizen.life › six-ways-removeuninstall-windows-programs-and-apps
9 ways to remove desktop programs and Microsoft Store apps in Windows
October 5, 2025 - Right-click or press and hold on their setup file and choose Uninstall. The uninstall option shown in the right-click menu of an MSI file The removal can also be triggered from the command line.
Top answer
1 of 2
1

No Silver Bullet

There is no silver bullet when it comes to automating installation or uninstallation - but there is a quick trick that is described in the "General Uninstall" section.

There are heaps of different flavors of installer types - and the list keeps growing. Automating them is a bit of a black art as you will be fully aware of. Not rocket science, but tedious and tiresome when things don't work reliably and there is no suitable remedy that consistently works all the time.

I have written about these issues many times before and cross-linked the content very heavily. It is messy, but if you follow the links and web of linked pages below you should be able to find the information you need for many different setup.exe and installer types.

General Uninstall

Before going into the below ad-hoc list of different types of installers / uninstallers and how to handle their command line parameters. I want to add that you can find a list of most of the products installed on the system in these registry locations:

  • HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall (64-bit)
  • HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall (32-bit)
  • HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall (per-user)

By checking for UninstallString or equivalent for a specific entry under these parent keys, you can get a general idea of how to uninstall the product in question by command line.

Try this simple approach first, but do read the material below for a better understanding of how installers of various kinds operate. Not all deployment tools and deployment operations register properly in these locations.

Apps are not found in these locations in the registry, only MSI installers (Windows Installer) and some - or most - of legacy setup.exe installers.


Installer Types & Uninstall (and extract for setup.exe)

  1. "Unattended.com": The easiest and quickest read on the topic of automating install / uninstall could be this one: http://unattended.sourceforge.net/installers.php
    • This is aging content, but I remember it as helpful for me back in the day.
    • And crucially it is not my own content - so I don't link entirely to myself! :-) (most of the links below are earlier answers of mine). Apologizes for that - it is just easier to remember your own content - you know it exists - and it is easier to find.
  2. MSI: The most standardized packages to deal with are MSI packages (Windows Installer).
    • They can be installed / uninstalled in a plethora of reliable ways: Uninstalling an MSI file from the command line without using msiexec. The most common approach is to use the msiexec.exe command line (section 3 in the linked answer). Do read this answer please. It shows the diverse ways Windows can invoke an install / uninstall for MSI files (command line, automation, Win32, .NET, WMI, Powershell, etc...)
    • Though complicated Windows Installer has a number of corporate benefits of major significance compared to previous installation technologies. Standardized command line and suppressible GUI for reliable install / uninstall are two of the most important benefits.
    • The standard msiexec.exe command line
    • How can I find the product GUID of an installed MSI setup?
  3. Setup.exe: Installers in setup.exe format can be just about anything, including wrapped MSI files (Windows Installer). For MSI files wrapped in setup.exe files you can use the previous bullet point's standard mechanisms to uninstall (they are registered by product code GUID). Below are some links on how to extract the content of setup.exe files for various types of setup.exe files and also links to pages documenting the actual setup.exe command line parameters:
    • General Links: There is some information on how to deal with different types of setup.exe files here: Extract MSI from EXE
    • Installshield: is a tool used to create setups of both legacy and modern MSI types. It delivers setup.exe files that are actually in many different formats and some with differing command line switches.
      • There is a description of Installshield setup.exe peculiarities here
      • Here is the official documentation for Installshield setup.exe files
      • Here is a simple explanation of setup.exe extraction for Installshield setup.exe files
    • Wise: was another important tool that is now off market. Many Wise-compiled setup.exe files are still in use. Here is a brief overview of Wise switches
    • Advanced Installer: is a current tool used by many to make setup.exe / installers. http://www.advancedinstaller.com/user-guide/exe-setup-file.html
    • WiX: this is an Open Source toolkit used to compile MSI files and setup.exe files / installers. It is quite common to encounter WiX-compiled files.
      • WiX installers can be in standard Windows Installer format such as MSI, MSP, etc... In this case use the options listed in bullet point 2 to deal with them.
      • There is also a way to compile setup.exe files with WiX. I only know of this "unofficial list" of switches to link to. The basic uninstall format is: setup.exe /uninstall /passive /norestart
      • You can also open a command prompt and go setup.exe /? to get a list of parameters for WiX (and other) setup.exe files.
      • There is also a WiX tool that can be used to decompile MSI files and also to decompress a WiX setup.exe file. See relevant section here: How can I compare the content of two (or more) MSI files?
  4. Other Tools: There are many tools that can be used to create installers / setup.exe files. Here are some of the bigger ones (just FYI - no command line switches to find here, just product information):
    • Non-MSI installer tools: http://www.installsite.org/pages/en/tt_nonmsi.htm
    • Windows installer tools: http://www.installsite.org/pages/en/msi/authoring.htm
    • Sys-admin tools for deployment: http://www.installsite.org/pages/en/msi/admins.htm
    • This may also be of help: Wix - How to run/install application without UI
  5. Apps: And there is the whole new world of apps.
    • How to silent install an UWP appx?
      • Add-AppxPackage
      • Remove-AppxPackage
    • Install UWP apps with App Installer
    • Install Windows Store App package (*.appx) for all users
    • Install package (appxbundle) via .appinstaller to all users on machine

Other Links:

  • How to create windows installer
2 of 2
0

I figured it out myself and it works for many projects which have .exe setups. Following is the format 1. Open terminal with admin rights 2. go to path in where setup that you used to install the product. 3. Once there then type: setupname.exe /uninstall /q

🌐
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. How to uninstall a program on a Mac. How to remove an app on a smartphone or tablet.
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...

🌐
Reddit
reddit.com › r/steamdeck › anyone know how to uninstall an app via terminal?
r/SteamDeck on Reddit: Anyone know how to uninstall an app via terminal?
June 11, 2022 -

Long story short, I tried to install Retrodeck but something didn't go right and now it's causing the Discover app to crash when I try to view my installed apps. And it throws this error when I open Discover

Error updating appstream2: No such ref 'appstream2/x86_64' in remote retrodeck-origin: Error updating appstream: No such ref appstream/x86_64' in remote retrodeck-origin

The app got installed and I launched it in Desktop mode. I don't really want to use it anymore so wanna uninstall, but I can't via Discover.

Anyone know the command to get a list of all installed apps and the the command to uninstall it? I'm having trouble finding it online.

🌐
Reddit
reddit.com › r/osx › how to use terminal to delete apps?
r/osx on Reddit: How To Use Terminal To Delete Apps?
November 17, 2019 -

I tried to install the new Catalina update, and I guess it didn't have enough space (it didn't say, it started the update process). I don't think it finished, and now I can't get past my login screen without my Macbook (Pro, 2015) shutting down. I've tried everything, and all I can think to do is free up space and re-install Catalina through recovery mode.

I need to free up 4 more gbs of space. I can't get to my applications folder, since I can't log in, so I was wondering how can I use the terminal to do it? I was going to delete my Adobe applications, but when I've followed instructions to get into my Applications folder path, I don't see any of the apps.

Any help/advice would be very appreciated. I really don't wanna have to wipe my drive.

🌐
Microsoft Learn
learn.microsoft.com › en-us › answers › questions › 2460572 › how-to-uninstall-applications-using-command-prompt
how to uninstall applications using command prompt - Microsoft Q&A
I have done it many times. You just need to be careful that you're uninstalling the right application. However, he left out some important facts: 1.- The proper registry key to find the Uninstall command of a program is under: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
🌐
Reddit
reddit.com › r/powershell › script to uninstall program
r/PowerShell on Reddit: Script to uninstall program
August 27, 2024 -

Hello all, Not directly power shell but this is the closest sub I could find that may be able to help. I am trying to uninstall a program and clean up afterwards by deleting the associated folders, but running into issues when combining all the commands as a script.

What I have so far is:

  • @ECHO OFF

  • Net stop tripwireAxonAgent

  • Wmic

  • product where name="Axon Agent" call uninstall /nointeractive

  • Quit <=(here is where I have the issue)

  • RMDIR /s /q "C:\ProgramData \Tripwire\Agent"

  • Pause

My main issue is after the product uninstall via WMIC, it will not exit that prompt and remains inside the subsection for it. I’ve tried “quit” “exit” and CD back to the default c:\windows but any command I enter says “syntax error” and just puts the command to delete the directory on screen and freezes the screen.

If I run the commands by themselves, there is no issue and it completes without a problem.

What am I missing / not doing properly. Any help is appreciated.

Also, for reference, I used WMIC to uninstall the program because the MSI the vendor was telling me to use was consistently giving me errors saying “ a product is already installed. You cannot install this version.” or I would get an error saying “ the product is not installed”

Would it be easier to switch this over to power shell to complete the task? I did not originally use power shell because the vendor said there may be issues when using it.