Uninstall product using windows 'wmic' tool

Please use below script to uninstall specific product (example 'winzip 20.0 '),

import os;
out=os.popen('wmic product where name="WinZip 20.0" call uninstall').read();
print(out);

Note: Get installed product name list using command ‘wmic product get name

Sample output would be,

Could this script be adapted to allow for an internal blacklist that we can build up based on programs that we would always want to be removed. Bonus if we can blacklist by company or use wildcards so version numbers in the names don’t matter.

Love that idea @PromptCare – should be able to just create a list variable and loop through it. i need to brush up on my python.

Hi @PromptCare @indieserve

We can do the script where you would be able to edit blacklist list variable and run it to remove mentioned applications.

I also want to mention below points,

  1. Windows wmic tool helps to remove ‘MSI’ packages only.

  2. You can run command " wmic product get name,version" to know the software list detected by wmic. (you can see exe packages being missed )

  3. Uninstallation method or command differs for Exe applications.

Please share your feedback.

Thanks

  1. Get list of all programs installed (as shows up in Add/Remove).
  2. Go through the Blacklist and use WMIC to uninstall those which it can.
  3. Confirm it’s been uninstalled.
  4. Go through the remaining entries vs blacklist and try standard methods (" /uninstall", " /x", its uninstallstring, etc.) to remove.
  5. Use a timeout method to kill hung uninstallers (that may have hidden windows waiting for interaction)
    5.5 If a timeout doesn’t happen (yay), confirm it’s been uninstalled.
  6. Report any which could not be removed.

Hi @PromptCare

We will update you with requested script soon.

Thanks
Kannan

Hi @PromptCare,

Please refer the links for your request, kindly let me know your feedback.

Please follow the link one after another : )
https://forum.mspconsortium.com/forum/script-library/11001-procedure-to-uninstall-the-list-of-programs-from-your-endpoint#post11001
https://forum.mspconsortium.com/forum/script-library/11001-procedure-to-uninstall-the-list-of-programs-from-your-endpoint?p=11007#post11007

Thank you.