Search code examples
batch-filewmic

How do I not echo WMIC in a batch file


I am running the below command as part of a logon script, and would like to make sure the result isn't echoed:

wmic qfe | find "3033929"

I tried placing an @ before the line but don't really know what else to try.

Thanks


Solution

  • Prefixing with @ tells cmd not to echo the command before executing it.

    wmic qfe | find "3033929" >nul
    

    sends the output of the find to nowhere. errorlevel will still be set (0=found, non-0=not found)