Search code examples
cmdwmic

How to pipe info from wmic to a txt doc


I need to take the info i get from running wmic:root\cli>/node:COMPUTERNAME product get name,version,vendor to a txt document I've been searching for the answer but can't seem to find it. I've done it before but you know how it goes if you don't do something all the time you forget.

Thanks in advance


Solution

  • WMIC has a Global /OUTPUT switch, which must preceed any <command>. To direct /OUTPUT to a file,

    C:\Windows\SysWOW64\wbem\WMIC.exe /OUTPUT:<path><filename> product get name,version,vendor
    

    Allegedly, the destination of /OUTPUT: can be configured to CLIPBOARD, STDOUT or <filename>, but I've yet to get it to operate as desired.

    I envision querying a host to check for the presence of an installed app. Something along the lines of,

    C:\Windows\SysWOW64\wbem\WMIC.exe /OUTPUT:STDOUT | Find "<app-name-here>" product get name