so I want to make a batch script to uninstall a program that is present both in Control Panel and the Settings menu with the same name. However when I run the command wmic product where name="Mechanic Manager" call uninstall /nointeractive I get this output:

Executing (\\USER\ROOT\CIMV2:Win32_Product.IdentifyingNumber="{905F5A3C-0321-4935-9A64-E96F32D3DC83}",Name="APPNAME",Vendor="MeLul",Version="1.0.0")->Uninstall()Method execution successful.Out Parameters:instance of __PARAMETERS{ReturnValue = 1603;};

Even after this when I go to Control Panel or the Settings menu the program is still there and its files are still in place. What am I doing wrong?

Edit: Found out that it happened because I wasn't running the command with enough privileges. Running the batch as admin solved the issue.

1

Best Answer


I have ran into this issue before. The msiexec.exe service sometimes gets caught up. 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. With the same code. If that doesnt work clear out again and manually do it by creating a batch script and installer and run batch script. wmic /node:"computername" process call create "C:\folderwithbat\batfile.bat" and do it like that. It should work then. If that doesnt work restart windows installer.