5

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

2 Answers 2

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.

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
2
  • 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. Apr 14, 2017 at 3:44
  • 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. May 19, 2017 at 2:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.