Open Windows Store App (UWP App) via Command Line: A Comprehensive Guide
Are you looking for a way to open Windows Store apps (Universal Windows Platform apps) via the command line? Look no further! In this article, we will explore the key concepts, techniques, and command-line tools to help you launch UWP apps quickly and easily. We'll cover topics such as:
- Introduction to UWP apps and the Windows App Store
- PowerShell techniques for listing installed apps
- The
startcommand and its application - Advanced options for customizing the app launch experience
- Introduction: UWP Apps and the Windows App Store
Universal Windows Platform (UWP) apps are a type of application designed to run on various Windows devices, including desktop PCs, laptops, tablets, and even smartphones. These apps can be installed from the Windows App Store, which offers a wide range of both free and paid applications for various purposes.
- Listing Installed Apps with PowerShell
Before you can launch a UWP app from the command line, you need to find its package name. You can do this by using PowerShell to list all installed apps.
2.1. PowerShell Techniques: The Basics
To list all installed apps, open PowerShell and run the following command:
Get-AppxPackage | Select-Object Name, PackageFullName
This command will display a list of all installed apps, along with their corresponding package names.
2.2. Refining Your App List
If you'd prefer to view only the apps with a specific name or keyword, you can use the Where-Object cmdlet. For example, to list all installed apps containing "Microsoft" in their name, run:
Get-AppxPackage | Where-Object { $_.Name -like "*Microsoft*" } | Select-Object Name, PackageFullName
Take note of the package name for the app you want to launch.
- Utilizing the
startCommand
To launch a UWP app from the command line, you can use the start command. The general syntax is as follows:
start <PackageName>
Replace <PackageName> with the package name of the app you want to launch.
3.1. Accounting for Version Numbers
If you encounter issues launching an app, specifically a "Class not registered" error, try including the version number as part of the package name. To find the correct version number for an app, refer to the output from the PowerShell command in Section 2.
The proper format for including the version number is:
start <PackageName>!*<VersionNumber>
For instance, if you want to launch the Microsoft Edge app with version number 100.0.1185.39, use:
start Microsoft.MicrosoftEdge_100.0.1185.39!*MicrosoftEdge
- Advanced Options
You can further customize your app launch experience with specific parameters and options.
4.1. Opening a Specific App Page or Feature
Some UWP apps support additional command-line parameters to open specific pages or features. You can find these by consulting the app's official documentation or by searching for related articles or forum posts.
For example, the Windows Calculator app supports opening the scientific calculator with the -scientific parameter. The appropriate command is:
start WindowsCalculator_8wekyb3d8bbwe!App -scientific
4.2. Running as Administrator
If you need to run the UWP app with administrator privileges, you can use the runas command followed by the start command.
runas /user:<AdminUsername> "start <PackageName>!*<VersionNumber>"
Replace <AdminUsername> with your administrator account username.
- Summary and References
This article has covered the key concepts and techniques needed to open UWP apps from the command line. We have explored PowerShell cmdlets, the start command, and various advanced options to help customize the app launch experience.
Types of References
- Online Resources:
- Books:
- Windows PowerShell Cookbook by Lee Holmes
- Windows Command-Line Administration Instant Reference by William R. Stanek
- Windows PowerShell Cookbook by Lee Holmes
- Articles: