You can try to use the Win32_Product CIM class’s Uninstall method.

$Prod = Get-WMIObject -Classname Win32_Product | Where-Object Name -Match  'PrintForm 2018 CS'
$Prod.UnInstall()

or

Get-CimInstance -Classname WIn32_Product | Where-Object Name -Match 'PrintForm 2018 CS' | 
  Invoke-CimMethod -MethodName UnInstall

if you want to get fancier, you can use the -Filter parameter when getting the WMI object and filtering at source - left as an exercise for the reader.

Answer from DoctorDNS on community.spiceworks.com
🌐
BigFix
forum.bigfix.com › content authoring
Uninstalling application using wmic command - Content Authoring - BigFix Forum
October 4, 2023 - I created a fixlet to uninstall a software from windows machine the command works from the command line but fails to uninstall the application through the fixlet. Command line: wiathidden cmd /C wmic product where “name like ‘%JAVA%’” ...
Discussions

Command line solution for removing apps not listed in wmic product, installed in user's appdata
HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall I'll leave the rest for the reader. :) More on reddit.com
🌐 r/sysadmin
7
0
October 13, 2022
WMIC software uninstall file in use prompt bypass
Hi, I’m trying to uninstall Adobe products on a select group of user’s PCs using this script. “wmic product where “name like ‘Adobe Acrobat Reader%’” call uninstall /nointeractive” The script works, I’ve tried it on a few test PCs. However, while uninstalling, a box pops up ... More on community.spiceworks.com
🌐 community.spiceworks.com
7
1
April 10, 2024
Using WMIC in a batch file to uninstall a program - Stack Overflow
I am writing a script to uninstall a program. I am utilizing WMIC to do this. When I run the script, it stops immediately after the wMIC command is run. When run it manually everything works fine. My More on stackoverflow.com
🌐 stackoverflow.com
Using WMI uninstall commands with variables?
I don’t want to create long scripts ... code uninstall strings and what not. On our PCs. Installed TeamViewer is a mix of versions and products. In Add/Remove programs, it might be: ... These were all manual installs. As there are multiple ways to remove each version, I’d like a ‘catch all’ using a common variable and WMI commands. So, I thought to use: wmic product where ... More on learn.microsoft.com
🌐 learn.microsoft.com
3
0
April 12, 2021
🌐
4iT
4it.com.au › knowledge base › uninstall windows program silently using the command line (wmic)
Uninstall Windows Program Silently Using the Command Line (WMIC) | 4iT
Here are the instructions for uninstalling a program on a windows computer that was installed using the Windows Installer. The first step is to find out the names of installed programs on the windows computer. To do this enter the following command: wmic product get name You will then see a ...
🌐
Action1
action1.com › home › blog › how to uninstall software remotely using wmi on windows?
How to Uninstall Software Remotely Using WMI on Windows? | Action1
March 21, 2025 - In the command window that opens, type “wmic” and press “Enter.” · Thus, we launched a console utility for interacting with the WMI structure on a local or remote computer. Now using the WMI Query Language (WQL), you can execute various WMI commands. For example, we get the entire list of installed software on a remote computer.
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.

🌐
Reddit
reddit.com › r/sysadmin › command line solution for removing apps not listed in wmic product, installed in user's appdata
r/sysadmin on Reddit: Command line solution for removing apps not listed in wmic product, installed in user's appdata
October 13, 2022 -

I can utilize SCCM to run commands I need to under the user's context, but some software doesn't show using wmic product, and cannot be uninstalled using powershell uninstall package.

However, these programs still show for the user in add/remove programs and uninstall from there when performed manually. I would just tell them to do this, but we cannot rely on user compliance and must ensure it gets done ourselves.

I imagine you could utilize some sort of registry query that tells you where to find an uninstaller, but I imagine that isn't even assured, not to mention some uninstallers or setup files requiring switches to function properly. I could also just delete the apps from appdata, but that would leave taskbar icons etc behind.

Even if it's a 3rd party program that has a command line interface (portable would be better), it would be a potential solution.

🌐
Experts Exchange
experts-exchange.com › articles › 4105 › Software-Uninstallation-using-WMIC-command-line.html
Software Uninstallation using WMIC command line | Experts Exchange
November 14, 2010 - And modify the following command's ProductName section. WMIC product where name="ProductName" call uninstall For instance... Hitting enter will begin the uninstallation process for the desired software.
Find elsewhere
🌐
H2S Media
how2shout.com › home › command line › how to use wmic command to uninstall software in windows 11 or 10
How to use WMIC Command to Uninstall software in Windows 11 or 10
January 12, 2024 - Once the installation of the Windows 11 or 10 installed program is completed, we can confirm wether the software has been successfully removed or not; for that you can again run “wmic product get name” command and ensure it’s no longer ...
🌐
YouTube
youtube.com › watch
Easy Guide: Uninstall Any Software in Windows Using WMIC Command - Step-by-Step Tutorial - YouTube
🔍 Struggling with unwanted software on your Windows PC? Discover the power of WMIC commands in this step-by-step tutorial! Whether you're a beginner or an e...
Published   February 25, 2024
🌐
Q's Tech Babble
qtechbabble.wordpress.com › 2022 › 08 › 04 › use-wmic-uninstall-scripts-to-simplify-mecm-application-silent-uninstalls
Use WMIC Uninstall Scripts to Simplify MECM Application Silent Uninstalls – Q's Tech Babble
July 27, 2024 - In terms of MECM Applications, WMIC provides us with a universal silent uninstall call for nearly any installed program which uses generalized parameters that aren’t specific to the application’s version. This means the uninstall command stays the same even as the application version changes. Let’s us Google Chrome as an example. When building an MECM Application Deployment Type for Chrome, one might check the Chrome’s Registry uninstall string at HKLM\SOFTWARE...
🌐
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 - Use WMIC PRODUCT NAME command to remove the program you want wmic product where name="<PROGRAM NAME HERE>" call uninstall /nointeractive
Top answer
1 of 3
1

After some excruciating trial and error, we found the below script that did the trick! Simple and elegant and quick. No need to install the NuGet module on systems. Copy and pasted this into our task sequence step in SCCM/MECM, and good to go! If you want to use for your own purposes, just replace 'TeamViewer Host" in the script with the name of the program you want to get rid of. This only works with MSI installed programs, not EXEs.

$uninstall32 = gci "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall" | foreach { gp $_.PSPath } | ? { $_ -match "TeamViewer Host" } | select UninstallString
$uninstall64 = gci "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" | foreach { gp $_.PSPath } | ? { $_ -match "TeamViewer Host" } | select UninstallString

if ($uninstall64) {
$uninstall64 = $uninstall64.UninstallString -Replace "msiexec.exe","" -Replace "/I","" -Replace "/X",""
$uninstall64 = $uninstall64.Trim()
Write "Uninstalling..."
start-process "msiexec.exe" -arg "/X $uninstall64 /qn" -Wait}
if ($uninstall32) {
$uninstall32 = $uninstall32.UninstallString -Replace "msiexec.exe","" -Replace "/I","" -Replace "/X",""
$uninstall32 = $uninstall32.Trim()
Write "Uninstalling..."
start-process "msiexec.exe" -arg "/X $uninstall32 /qn" -Wait}
2 of 3
1

You should never use Win32_Product, it has unintended side-effects that can/will cause issues. Serach the web for articles describing it as "Evil" for full details.

See https://home.memftw.com/uninstall-software-en-masse/ for a possible path.

🌐
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 - You'll see the wmic:root\cli> prompt in the console once you run the WMIC command. This means you can now use Windows Management Instrumentation (WMI) operations. Next, you'll want a list of the programs installed on your computer. Getting this list is essential because you must provide an accurate product name to successfully execute the uninstall command.
🌐
Reddit
reddit.com › r/sysadmin › anything like this generic wmic software uninstall line?
r/sysadmin on Reddit: Anything like this generic wmic software uninstall line?
October 31, 2024 -

wmic product where "name like 'SoftwareToUninstall%%'" call uninstall /nointeractive

I asked a few years ago. There's CimInstance. This line (I haven't tested this much myself, if you run this as is.)....

Get-CimInstance -Class Win32_Product -Filter "Name='software'" | Invoke-CimMethod -MethodName Uninstall

So great. Just user CimInstance in powershell and get a similar result.... But querying Win32_Product can have issues with doing an integrity check on all software and reinstalling everything. Something like that.

I was looking at pulling uninstall lines from here.

HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall HKLM: \Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall

It depends how software was installed for what works to uninstall it. I found the wmic line useful and still used it after wmic was deprecated. I haven't found anything that's a nice simple one-liner like it, although, yes, it's not perfect.

🌐
Stack Overflow
stackoverflow.com › questions › 65708791 › trying-to-uninstall-a-program-using-wmic-doesnt-actually-uninstall
windows - Trying to uninstall a program using wmic doesn't actually uninstall - Stack Overflow
Try to wmic /node:"computername" process where name="msiexec.exe" delete and then double check it deleted by either running command again or looking yourself by wmic /node:"computername" process list brief after it is gone try uninstalling agian.
🌐
Mundobytes
mundobytes.com › worldbytes › windows › how to uninstall a program from cmd in windows (wmic and winget)
How to Uninstall a Program from CMD in Windows (WMIC and WinGet) - Mundobytes
August 20, 2025 - This is especially useful when the Settings app, Programs and Features, or the software uninstaller itself are not responding., when the system is saturated or when you need to uninstall several apps and batch games for multiple applications at once. WMIC (Windows Management Instrumentation Command-line) was for years the most direct command to uninstall from CMDIt works on local computers and, with the appropriate credentials, can also be used against remote computers in administration scenarios.
🌐
Freedom IT Limited
freedomit.co.nz › knowledgebase › 200-using-wmic-to-manipulate-installed-programs
Using WMIC To Manipulate Installed Programs - Freedom IT
May 3, 2023 - wmic product where name="<PROGRAM NAME HERE>" call uninstall /nointeractive wmic product where "name like '<PROGRAM NAME HERE>%%'" call uninstall /nointeractive