How to list all applications displayed from add/remove WinXP/Win7 via command-line?

5

1

I'm trying to list all applications installed that are displayed in the add/remove programs list (WinXP/Win7) via command-line. I understand that for Win7 it's called "Programs and Features" from the cp.

I've tried wmic but that only lists programs installed using MSIs. I've tried quering the registry (HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall & also wow6432node).

I still can't trap Spotify (good exampe); it appears in the add/remove section but not in these locations.

Any thoughts?

-Dom

dom9360

Posted 2013-11-28T01:25:53.160

Reputation: 63

Answers

5

It looks like this can be done from the wmic command
Try this:

wmic product  

Shows a list of everything installed on the computer
Sources:
http://www.sepago.de/d/helge/2010/01/14/how-to-list-all-installed-applications-from-the-command-line http://technet.microsoft.com/en-us/library/bb742610.aspx#ECAA

This page says it's for Windows Vista and 7, but I have tested wmic on Windows XP as well
Get list of installed applications from Windows command line

Also, this page explains that the method of checking the registry entry may not be accurate
http://community.spiceworks.com/how_to/show/2238-how-add-remove-programs-works

Here is some more information on what else can be done using wmic:
http://betanews.com/2011/01/14/wmic-the-best-command-line-tool-you-ve-never-used/
From this website, specifically for your problem:

The program can also provide details on many other aspects of your system. Commands like:

wmic product list brief

wmic service list brief

wmic process list brief

wmic startup list brief

will list your installed software, services, running processes and Windows startup programs, for instance.

user13267

Posted 2013-11-28T01:25:53.160

Reputation: 805

0

I don't think you'll be satisfied with any of the cmd approaches as they will not be complete. If you're okay with Powershell, then this gave me everything:

If(!([Diagnostics.Process]::GetCurrentProcess(). Path -match ‘\\syswow64\\’)) {
$unistallPath = “\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\”
$unistallWow6432Path = “\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\”
@( if (Test-Path “HKLM:$unistallWow6432Path” ) { Get-ChildItem “HKLM:$unistallWow6432Path”} if (Test-Path “HKLM:$unistallPath” ) { Get-ChildItem “HKLM:$unistallPath” } if (Test-Path “HKCU:$unistallWow6432Path”) { Get-ChildItem “HKCU:$unistallWow6432Path”} if (Test-Path “HKCU:$unistallPath” ) { Get-ChildItem “HKCU:$unistallPath” } ) | ForEach-Object { Get-ItemProperty $_.PSPath } | Where-Object { $_.DisplayName -and !$_.SystemComponent -and !$_.ReleaseType -and !$_.ParentKeyName -and ($_.UninstallString -or $_.NoRemove) } | Sort-Object DisplayName | Select-Object DisplayName
}
else {
“You are running 32-bit Powershell on 64-bit system. Please run 64-bit Powershell instead.” | Write-Host -ForegroundColor Red
}

pause

Adrian Nielsen

Posted 2013-11-28T01:25:53.160

Reputation: 1

So, I am not a powershell guy, but I tried to edit your post to make it legible, and it is only slightly better. Can you please edit you post to make the code clear? Key is to indent the code with 4 spaces, and look at the preview below the editor to make sure it looks good. – Stephen Rauch – 2017-04-14T03:44:04.223

Yeah, I'm not really either, but once I found out that wmic didn't necessarily produce all programs in the programs list I scoured the internet for days looking for a code that would produce everything. If I knew it better, then I would certainly clean it up. Thanks for your input. – Adrian Nielsen – 2017-05-19T02:23:25.537