Collecting lists of installed software can be a royal pain in the you-know-what. I recently needed to collect the names of the applications installed on my system as I prepare to move from XP to 7. Still on XP Pro and no issues. To me, it is pretty stable, but that is not the point of this post.
I tinkered a bit with some AutoIT code to come up with a list of those applications installed on my PC, and this is what I came up with:
$file = FileOpen(@ScriptDir&"\RegInstalledItems.csv",1)
if $file = -1 Then
ConsoleWrite("ERROR: Unable to write to the output file")
$i = 1
While not @error
$var = RegEnumKey("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall", $i)
If @error <> 0 then ExitLoop
;MsgBox(4096, "SubKey #" & $i & " under HKLM\Software: ", $var)
$var2 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"&$var,"DisplayName")
$outLine = $var&","&$var2
$i += 1
This code opens a text file, reads through those apps that would be listed in the Add/Remove programs and places the registry entry name and the display name in a comma delimited file. From here you can print or do what you wish with the file to better know what to move over to the new install. Big time saver. Need to do this against remote systems? You can add a loop around this script to read through a list of server names for instance. Then with the “RegEnumKey” and “RegRead”, you will need to add the system name to the beginning of the registry key. For example:
You can probably imagine a number of other uses for this as well like software inventory, etc. Add some filtering code or create another batch of code to parse the output and voila, life made easier.