Enumerating the If... Then: Scripts

Monday, December 08, 2008

Command Line: Query a Remote Windows for a specific installed program, write the output to a file

Tested.
In use at work.


This will allow you to query a single host, but you can pipe a hostname into this batch.

Usage: me.bat hostname program


@echo off
echo %1 >> list_%2.txt
reg query \\%1\HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall /s | find " DisplayName" | find /i "%2" >> list_%2.txt
list_%2.txt

0 Comments:

Post a Comment

<< Home