msiexec /x {ProductCode} doesn’t work

I’ve been having a fun week at work fighting bits of software and one bit required the removal of a Microsoft SQL Native Client. I first tried to do this using “msiexec /x {ProductCode}” and got “This action is only valid for products that are currently installed”

So I did a bit of google searching to see if there’s any chance I’ve got my product code I’m trying to uninstall wrong and came across wmic.

Now I get something much easier to remember off the top of my head. The command line to uninstall the SQL Native Client I’m using being:

wmic product where “name like ‘%SQL Native Client%'” call uninstall

Okay it takes a few seconds for wmic to do it’s work, but for the simple fact it’s using command lines I can write off the top of my head without first hunting the registry for class ID’s I’m rather happy!

I’m also quite liking how easy it is to pull the hard drive is failing type status out of WMI using WMIC.

C:UsersMike>wmic diskdrive get model,status
Model                                                                    Status
WDC WD5000AAKS-00A7B2 ATA Device  OK

Pred Fail is the answer we don’t like for status. I’m glad this my own machine isn’t showing the same failure  as the machine we found at work that was complaining of a hard disk drive about to fail.

This entry was posted in Software. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s