none
Batch file that will uninstall a program with version based if it was installed on windows 10 64-bit or 32-bit RRS feed

  • Question

  • I do have a application installed on windows 10 machine.

    The application has

    • Newer version (2.0)
    • Older version(1.0)

    I would like to uninstall Older version of the application which is 1.0.

    Below is the batch script I would like to use.

    @Echo Off
    Title App_Older 1.0
    Echo App_Older 1.0
    Echo Y|WMIC Product Where "Name='App_Older'" Call Uninstall
    

    Can I get some help on below code!

    How can I add a where clause in below code so that I can mention the version of Application to be deleted too..

    For ex (Just to show , needed help on this to avoid wrong uninstalls):

    Please correct the below code. I would like to get the version parameter added.

    @Echo Off
    Title App_Older 1.0
    Echo App_Older 1.0
    Echo Y|WMIC Product Where "Name='App_Older'" 
    and "Version='1.0'" Call Uninstall
    

    Thanks


    Best Regards,SQLBoy

    • Moved by Bill_Stewart Tuesday, December 11, 2018 9:41 PM This is not "scripts on demand"
    Tuesday, July 31, 2018 4:28 PM

All replies

  • Normally upgrades replace the existing version.  Contact the vendor to learn how to do this with options.


    \_(ツ)_/

    Tuesday, July 31, 2018 4:57 PM
  • This should work..

    @Echo Off
    Title App_Older 1.0
    Echo App_Older 1.0
    Echo Y|WMIC Product Where "Name='App_Older' and Version='1.0'" Call Uninstall

    Tuesday, July 31, 2018 10:33 PM