Reputation: 10830
The same compiled .Net / C++ / Com program does different things on two seemingly same computers. Both have DOZENS of things installed on them. I would like to figure out what the difference between the two is by looking at an ASCII diff. Before that I need to "serialize" the list of installed things in a plain readable format - sorted alphabetically + one item per line.
A Python script would be ideal, but I also have Perl, PowerShell installed.
Thank you.
Upvotes: 0
Views: 6382
Reputation: 165
Taken from List installed software from the command line:
If you want to list the software known to Windows Management Instrumentation (WMI) from the command line, use WMI command line (WMIC) interface.
To list all products installed locally, run the following command:
wmic product
Caveat: It seems that this command only list software installed through Windows Installer. See Win32_Product class
Upvotes: 1
Reputation: 12704
Personally I always liked sysinternals' stuff (powerfull, light, actual tools - no need to install)
There is command line tool psinfo that can get you what you want (and then some) in various formats, distinguishing hotfixes and installed software, on local or remote computer (providing system policies allow it on remote).
You can also run it live from here, so though not strictly pythonic you could plug it in quite nicely.
Upvotes: 1
Reputation: 1023
There are two tools from Microsoft that may be what you need: RegDump and RegDiff. You can download them from various places, including as part of the Microsoft Vista Logo Testing Toolkit.
Also, there is Microsoft Support article How to Use WinDiff to Compare Registry Files.
For a Pythonic way, here is an ActiveState recipe for getting formatted output of all the subkeys for a particular key (HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall for example).
Upvotes: 1
Reputation: 62031
You can get the list of installed programs from the registry. It's under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
If this is a once-off exercise you may not even need to write any code - just use Regedit to export the key to a .REG file. If you do want to automate it Python provides the _winreg module for registry access.
Upvotes: 1