简体   繁体   中英

Trying to uninstall a program using wmic doesn't actually uninstall

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM