In Windows, how can I get a list of all installed programs via script?

2

0

I'm trying to figure out how to get a list of all installed applications using a script. My O/S is Windows 7 x64.

I've found several purported mechanisms to generate a list of installed applications, however I've discovered that using the registry, wmic, etc produces a list that doesn't match the list found in Control Panel > Programs and Features (the generated lists are missing programs that show up in Control Panel).

Essentially, I just want to find a way to take the exact list that is displayed in Control Panel under Programs and Features and either export it or otherwise access that list programmatically.

I found an old thread on TechNet which is asking for exactly the same thing, but unfortunately no working solution was ever provided. The OP on that thread is running into exactly the same issues I am.

https://social.technet.microsoft.com/Forums/windows/en-US/19c1f1cf-3a3b-4a66-b830-d8a68c5d493d/get-list-of-installed-program-exactly-as-in-control-panel?forum=w7itprogeneral

Hopefully that doesn't mean that this is impossible. If the computer itself is displaying the info I want, it seems like there must be some way for me to get access to it as well unless it's locked up in some closed Windows API.

vrtigo1

Posted 2015-07-01T21:48:04.413

Reputation: 93

2

Did you check answers at this StackOverflow question? They should show where installation information is stored and how to obtain it so your question can be possibly reduced to "how can I access these resources using script?" If you study a bit and write some script, folks at [so] could help you if you get stuck at some point.

– miroxlav – 2015-07-02T00:48:41.330

Basically the add/remove software list is exactly what is stored in: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall as stated (which can widely differ from what is really installed, no one is forced to make entries there), If you see a difference there my main suspicion would be that you have 64Bit windows. In this case there exist 3 different versions, one in HKCU\SOFTWARE one in HKLM\SOFTWARE and one in HKLM\SOFTWARE\Wow6432Node. Iirc the Windows GUI will show all of them together – Syberdoor – 2015-07-02T06:27:46.850

What exactly is wrong with Get-WmiObject -Class Win32_Product | Select-Object -Property Name the author of that thread isn't clear why that command cannot be used. It generates a list with the exact information you want. – Ramhound – 2015-07-02T11:49:33.380

Get-WmiObject -Class Win32_Product | Select-Object -Property Name - as noted this doesn't return a list that matches control panel. Items are missing.

The note about having three separate sections in the registry which show software uninstall info is interesting and I'll look into that to see if I can poll all three, combine and then deduplicate that list. Thanks! – vrtigo1 – 2015-07-02T12:40:28.107

Can you use the Win32Reg_AddRemovePrograms and Win32Reg_AddRemovePrograms64 classes? – Ramhound – 2015-07-02T17:12:16.097

No answers