Tuesday, June 17, 2014

Export a list of installed applications to a text file using data from the registry

This will export the contents of Add/Remove Programs to a text file

reg query \\servername\hklm\software\microsoft\windows\currentversion\uninstall /s /v "DisplayName">result.txt

Perform this on multiple servers
Create a file servers.txt that contains all of the target server names

for /f %x in (servers.txt) do @echo %x&@ reg query \\%x\hklm\software\microsoft\windows\currentversion\uninstall /s /v "DisplayName">%x.txt 2>&1

Result: This will create one file per server that contains the export of add/remove programs

for /f %x in ('dir /b *.txt') do type %x | find /i "displayname">%x-2.txt

Result: This will create one file per server that contains only the DisplayName data. You can open this in Word and use Find/Replace to create a report that is presentable.

Applies To
Windows Server 2003
Windows Server 2008 R1