How can I run a single command to show all installed applications in Windows 10?
"Programs and Features", which can also be launched using the Control Panel file appwiz.cpl lists all applications which have registered themselves in a defined way in order to appear in this list. This is traditionally the main entry point to enable users to typically remove or modify applications that are installed.
I say traditionally, as Windows now has, under the new Settings options a 'Apps & Features' page (%Windir%\ImmersiveControlPanel\SystemSettings.exe). This list of applications also includes what are now referred to as Windows Modern apps, aka metro, full screen, or Windows Store apps. As the question was specifically about Programs and Features, this answer will not cover those.
As a developer, there are a variety of ways to create an installer to package an application, be it using Windows Installer, and therefore creating a MSI file, with a toolkit such as WiX or InstallShield. Then there are custom installers created by the developers. In any case to ensure your application appears in the above list, you only need to define two values despite there typically being many more standard values, these are:
- DisplayName
- UninstallPath
The "Uninstaller" keys, depending on the applications installed, can be found in the following registry locations:
32-bit computer:
- HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
- HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
64-bit computer:
- HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
- HKCU:\SOFTWARE\Wow6432nodeMicrosoft\Windows\CurrentVersion\Uninstall
- HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
- HKLM:\SOFTWARE\Wow6432node\Microsoft\Windows\CurrentVersion\Uninstall
Where: 32-bit applications on a 64-bit application are typically found under the Wow6432node. Those under HKCU are installer for the user, rather than the computer and is sometimes an option presented in the installer.
Therefore, to enumerate all applications installed, as Explorer.exe does, when you launch Program and Features, you have to consider the values under the above keys.
There is one additional point to note, applications can "hide" themselves from appearing in this list using the SystemComponent
DWORD. The value can be 1 or 0, where 1 would hide the application from the list. The intention I assume was for system components such as .NET which wouldn't typically be managed by the user to remain hidden. This is however typically used by vendors which install multiple components for a suite and then create a unified uninstaller to make it easier to remove the application in its entirety and to remove each component in the correct order.
Therefore, the following PowerShell command, will enumerate each of the above Uninstall keys, and where the SystemComponent is not 1 and there is a DisplayName value, will print the DisplayName:
foreach ($UKey in 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*','HKLM:\SOFTWARE\Wow6432node\Microsoft\Windows\CurrentVersion\Uninstall\*','HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*','HKCU:\SOFTWARE\Wow6432node\Microsoft\Windows\CurrentVersion\Uninstall\*'){foreach ($Product in (Get-ItemProperty $UKey -ErrorAction SilentlyContinue)){if($Product.DisplayName -and $Product.SystemComponent -ne 1){$Product.DisplayName}}}
Now of course there are other applications you might class as installed but if they don't register in one of the above locations they will not appear and are out of scope for the question.
There are other ways to get at the items in this list but may only return a subset due to only returning MSI based applications for example.