Running WMIC from within .bat fails?

Discussion in 'Scripting' started by Josh C, Nov 5, 2009.

  1. Josh C

    Josh C Guest

    I have a simple WMIC command that utilises a wild card search.

    wmic product where "name like 'Infocouncil%'" call uninstall

    When running this directly from a command prompt it works fine. However if I run the same command from within a .bat file it fails to find an instance of the product.

    Now if I remove the wildcard search in the bat file it works fine:

    wmic product where name="Infocouncil_5_3_19_0_" call uninstall

    Any ideas?


    EggHeadCafe - Software Developer Portal of Choice
    Dr. Dotnetsky's Cool .NET Tips & Tricks #15
    Josh C, Nov 5, 2009
    1. Advertisements

  2. Hi,
    Tom is right but If there are more than one products installed for "InfoCouncil" it will uninstall only the first one it finds.

    I am using a query in my batch file but instead of returning all the products it just gives me one.

    WMIC product where "name like 'Adobe%%'" get name

    I can see in my add remove programs that I have Adobe Reader, Adobe Flash Player and Adobe Shockwave Player but I am only getting Adobe Reader.
    tohighgatemotors, Sep 10, 2012
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.