How to list and run installed programs on Windows from command line
There are plenty of guides about listing installed programs on Windows from cmd and PowerShell, but few of them help you get a list similar to the “App list” tab in the Settings app. This method will let you list all programs you can find in the “Start Menu” or “App list tab”, and execute them.
Let’s get the list from this Powershell command:
PS C:\Users\admin> get-startapps
The Get-StartApps cmdlet gets the names and AppIDs of installed apps of the current user. This command will output a table with these information:
- Name: defines the name of the app
- AppID: defines a unique identifier for the app. We will use this ID to run the app from the command line
Note: if the output is limited to the width of the command line it will show AppIDs truncated with ellipses. Since we need the full lines we can pipe the command output to one of the built-in formatting tools.
PS C:\Users\admin> get-startapps | Format-List
AppIDs can have multiple formats:
- .exe: if the program was installed with an installer the AppID is the path to the executable (e.g. C:\Python311\python.exe). Note that sometimes Windows translates paths with GUID constants (KNOWNFOLDERID).
- UWP: if the program is a preinstalled Windows program (like the Edge browser app) or if it was installed using Windows Store, the AppID will be a store ID (e.g. Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge)
- Others: since this list is similar to the “Start Menu”, sometimes it can include URLs and paths to text files (e.g. C:\Python311\Doc\html\index.html)
For apps listed with the first two AppID formats we can use the same command for execution, it runs the explorer app and opens the app:
PS C:\Users\admin> explorer shell:appsFolder\{AppID}
This command will run the program just as if it was executed by the user.
What if I want to run this PowerShell commands from cmd?
No problem, you can run a PowerShell command from the command prompt with using “powershell”:
C:\Users\admin> powershell get-startapps
I keep getting “not recognized as an internal or external command”
That’s a very common error, it appears because powershell.exe and explorer.exe are actual executable programs, you can add them to PATH or call them with their global path (i.e. C:\Windows\explorer.exe)