How to uninstall software using batch file

39,100

Solution 1

I think WMIC commands can be run from a single line which should make it easier to add to a batch file. And by adding /nointeractive then it should disable prompting as well. Try something like this:

wmic product where name="software" call uninstall /nointeractive

Solution 2

Although that may be possible for certain specific installations it's not possible to do so for all installations. As Zypher has already indicated, it will depend a great deal on the installation system used. It will also depend on whether that system allows for a "quiet" uninstall.

I really can't image a "perfect method using WMI" but congratulations if you've found one. On the other hand, you've also discovered one of the things that will get in the way of achieving your goal.

Share:
39,100

Related videos on Youtube

Alexander G
Author by

Alexander G

Updated on September 17, 2022

Comments

  • Alexander G
    Alexander G over 1 year

    I want to uninstall a software by calling a bat file. It must be automatically, without entering any parameters during the uninstallation. How to make the bat file which would be able to uninstall software by name?

    PS: I know the perfect method using WMI, but it requires user input:

    WMIC
    product where name="software" call uninstall
    
    • Zypher
      Zypher over 14 years
      This is going to depend on how the program was originally installed. MSI, InstallShield, etc.
  • jbyrd
    jbyrd over 7 years
    This is awesome...will this exit gracefully if there's no software with the name specified (if you've already uninstalled it, for example)?