Windows provides several command-line tools for uninstalling software from user computers. You must select the appropriate tool based on the Windows version, the application type (MSI, classic Win32, or Microsoft Store app), and the installation scope, whether the program is deployed per-machine (for all users) or per-user (for the current user). In this article, we will explore various methods for removing programs installed in Windows from the command prompt or PowerShell console, including both interactive and silent uninstallation techniques.
How to Uninstall a Program Using PowerShell in Windows 11 or 10
In Windows 11 and 10, as well as in Windows Server 2025, 2022, 2019, and 2016, you can use cmdlets from the built-in PowerShell PackageManagement module to install and uninstall software. This is the simplest and most universal way to uninstall programs in modern versions of Windows. It’s worth trying first. It allows you to uninstall programs installed through the Windows Installer service (MSI packages), as well as traditional Win32 applications and MSU-based Windows updates.
To list the installed program packages on your computer, run the command:
Get-Package
The command returns a list of programs installed through the different providers (ProviderName). You can display a list of providers on a computer as follows:
Get-PackageProvider
- Programs
- Msi
- Msu
- PowerShellGet
- NuGet
To list programs installed via a specific package provider, run this command:
Get-Package -ProviderName Programs -IncludeWindowsInstaller
Use a pipeline with the Uninstall-Package cmdlet to remove a program (note that I use the wildcard character * to avoid typing out the entire program name):
Get-Package -Name "Notepad++*" | Uninstall-Package
You can remove the installed PowerShell module. For example, to uninstall all VMware.PowerCLI modules:
Get-Package -ProviderName PowerShellGet -Name "VMware.*" | Uninstall-Package
To uninstall a program on a remote computer, use the Invoke-Command cmdlet:
Invoke-Command -ComputerName mun-dc01 -ScriptBlock { Get-Package -Name "Notepad++*" | Uninstall-Package}
Uninstalling Microsoft Store (UWP) Apps Using PowerShell
Use the PowerShell cmdlets Remove-AppxPackage and Remove-AppxProvisionedPackage to uninstall Microsoft Store (UWP) applications in Windows.
List the Microsoft Store apps that are installed for the current user:
Get-AppxPackage | select Name,NonRemovable,PackageUserInformation,PackageFullName
Remove the application only for the current user:
Get-AppxPackage *BingWeather* | Remove-AppPackage -verbose
Remove the app for all users:
Get-AppxPackage *BingWeather* -AllUsers| Remove-AppPackage –AllUsers -verbose
How to Uninstall a Software Using the WinGet Command
You can use the new WinGet package manager (it is built into Windows 10 and 11) to install and remove programs on Windows. To get a list of installed programs on your computer, run:
winget list
The command returns a list of programs, including those installed without WinGet, as well as a list of Microsoft Store apps.
To remove an app installed via WinGet, specify its name:
winget uninstall --name 7zip.7zip
To uninstall an MSI app in Windows, specify its GUID:
winget uninstall --id "{332C1E78-1D2F-4A64-B718-68095DC6254B}"
To uninstall a Microsoft Store app, specify its PackageFullName.
winget uninstall --id "Microsoft.ZuneVideo_8wekyb3d8bbwe"
However, winget doesn’t natively allow you to uninstall programs on a remote computer. To execute the winget command on a remote computer, use the PowerShell Remoting features (Invoke-Command and Enter-PSSession cmdlets). For example:
Invoke-Command -ComputerName wkmn-man231 -ScriptBlock {winget uninstall --name 7zip.7zip}
Using WMI to Uninstall Apps in Windows
In previous versions of Windows, program uninstallation was commonly performed using commands that invoked the uninstall process through the WMI ( Windows Management Instrumentation) namespace API. I strongly advise against using these methods in modern versions of Windows, and I will explain why below.
For example, you can use the wmic command to query the WMI namespace and retrieve a list of installed programs:
wmic product get name,version
To uninstall a program silently, copy its full name from the list and run the following command:
wmic product where name="VMware vCenter Converter Standalone" call uninstall /nointeractive
The command invokes the WMI method, which uses Windows Installer to remove the program:
Executing (\\COMPName\ROOT\CIMV2:Win32_Product.IdentifyingNumber="{PROGRAM_GUID}",Name="VMware vCenter Converter Standalone",Version="6.2.0.8466193")->Uninstall()If the program is successfully uninstalled, it will return:
Method execution successful. Out Parameters: instance of __PARAMETERS {
ReturnValue = 0; };In PowerShell, the equivalent of the wmic command for accessing the WMI namespace is the Get-WmiObject cmdlet. The similar PowerShell commands for listing and uninstalling programs via WMI are shown below:
Get-WmiObject Win32_Product | ft name,version,vendor,packagename
(Get-WmiObject Win32_Product -Filter "Name = 'XXX'").Uninstall()
In order to remove a program on a remote computer, add the -ComputerName option. For example, to uninstall Microsoft Office on a remote computer, run the command below:
$apps = Get-WmiObject -Class Win32_Product -ComputerName wkmn-man23 |where name -Like "Office 16 Click-to-Run*"
$apps.uninstall()
The Get-WmiObject command is not supported in newer versions of PowerShell Core. Instead, use the Get-CimInstance cmdlet. List the installed software:
Get-CimInstance Win32_Product | ft name,version,vendor,packagename
Uninstall the program:
$MyApp = CimInstance -Class Win32_Product | Where-Object{$_.Name -eq "PowerToys"}
$MyApp.Uninstall()
Here’s why you should avoid using commands to uninstall software via the WMI API:
- This method only allows you to remove programs that were installed via the MSI Installer service (classic MSI packages).
- This cannot be used to uninstall Microsoft Store apps or PowerShell modules.
- The MSIInstaller service initiates a consistency check for each program when listing installed programs via the Win32_Product WMI class. This could potentially lead to changes to the current configuration of MSI apps. You can confirm it by the events with Event ID 1035 from MsiInstaller in the Application log:
Windows Installer reconfigured the product. Product Name: Zoom Workplace (64-bit). Product Version: 6.5.1234. Product Language: 1033. Manufacturer: Zoom. Reconfiguration success or error status: 0. - The processing of commands via WMI is extremely slow.
- The wmic command is not installed by default in the latest Windows 11 builds.
Get the Program Uninstall String from the Registry
As mentioned earlier, not all programs use the Windows Installer (MSI) for installation. However, regardless of the installation method, correctly designed programs are always registered in the registry during installation. They store information about the program and the specific command required to remove the software in the registry.
Information about programs installed for all users of the computer (per-machine) is stored under these registry keys:
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
- HKLM\SOFTWARE\Wow6432node\Microsoft\Windows\CurrentVersion\Uninstall
The user registry hive stores programs that are installed only in the current user profile (%userprofile%\AppData):
- HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
- HKCU\SOFTWARE\Wow6432node\Microsoft\Windows\CurrentVersion\Uninstall
For example, I located the 7-Zip tool registry hive and found the appropriate command for its removal in the UninstallString parameter value.
Since this program was installed via WMI, the msiexec command is used to remove it. So, to uninstall the app, run the following command:
msiexec /x the_application_GUID
The following PowerShell script queries the specified registry keys and displays the program names along with their removal commands:
$Installed = Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*
$Installed += Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*
$Installed += Get-ItemProperty HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*
$Installed += Get-ItemProperty HKCU:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*
In this case, I want to list the programs that were not installed via MSIEXEC:
$Installed| where UninstallString -notlike "*msiex*"|Select-Object -Property DisplayName, QuietUninstallString, UninstallString|fl
To uninstall a program, copy the command from the UninstallString value and paste it into the command prompt to execute it. Note that some apps include a command in the QuietUninstallString value that can be used to remove the program silently (without displaying any notifications or confirmations).
The commands and PowerShell scripts described in this article can be used to remove programs locally or remotely and automate software updates or removals on user computers via SCCM or GPO logon scripts.











1 comment
awsome,but still i got some problem when i try uninstall some application on my pc.when i try to use
Get-Package -Name “**” | Uninstall-Package,it stuck there for like ten more mins.took that so much time then i shut it down.