troubleshooting Question

WMIC UnInstall not working Correctly

Avatar of afrpa
afrpaFlag for United States of America asked on
Microsoft DOS
12 Comments1 Solution8443 ViewsLast Modified:
I am having a problem during the process of Uninstalling programs when using WMIC command.
I run the command to uninstall certain programs (such as ScanSnap Organizer [Used for scanning]), but after the command executes, and the results show the the program has been uninstalled, it still shows the program on the computer, and does not UnInstall it.

Verified the Product PackageCode, Name, ProductName, etc.  
I have attempted this process several times on several different computer,  with the same results.  [Computer names are correct]
I have attempted using the PackageCode, Name, and .msi name, with the same results.

Uninstall has processed using WMIC Command:
(\\%computer_name%\ROOT\CIMV2:Win32_Product.IdentifyingNumber="{********-A7F2-****-9242-*************}",Name="ScanSnap Organizer",Version="")->Uninstall()

This is the command I am using the Process the Uninstall.
wmic /failfast:on /node:"%ComputerName%" product where "PackageCode like '%ProgramCode%'" call uninstall /nointeractive  >>  ResultsOfUninstall.txt
        -and also tried the following.-
wmic /failfast:on /node:"%ComputerName%" product where PackageCode="%ProgramCode%" call uninstall /nointeractive  >> ResultsOfUninstall.txt

The Following Results Occur after running the Uninstall the First Time:
[Which shows that the program has been Uninstalled.]
Method execution successful.

Out Parameters:
instance of __PARAMETERS
        ReturnValue = 0;

After the execution for the Uninstall has run (as shown above), I check the
list of programs, and the program is still there.
So I try to run the WMIC execution again, but it gives the error that "No
Instances Available" - As if it is no longer installed.
The program is still operational, and has all its functionality (but it
should be uninstalled.)

Returns Value after 2nd attempt to uninstall using WMIC Command.
   Tried to run the WMIC uninstall process again, since the program still shows on the computer. But the following Results occur>
No Instance(s) Available.
No Instance(s) Available.
No Instance(s) Available.

Environment variables:
Client is running Windows 7, using Command Line to process the Script for WMIC uninstall.  Admin privlidges are being used to process and run the script (WMIC uninstall.)

Is there a better way to do this, or am I doing something incorrect?
Is there a more convential way to process this through scripting (I need to process several uninstalls on many computers.)?

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 12 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 12 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros