Monday, January 16, 2017

Launch a store installed app from the command line

How to launch an app from the store

Use the name of the install folder: ">start shell:AppsFolder\{folder}!App". e.g '>start shell:AppsFolder\Microsoft.WindowsStore_8wekyb3d8bbwe!App'

Or, if it has one, use the app's one own URI scheme: ">start {scheme}:". e.g '>start ms-settings:'

Applies To : Windows 10



Starting a normal app from the command line (or a script, or a scheduled task) is easy. Just start the executable.
But apps that are installed from the Windows Store don't have executables. So how do you start them?

The simplest way is if the app has a custom URI scheme. If it does then it's just a case of calling 'start' and then the scheme. So, you could do something like this:

>start ms-settings:

If you want to add a custom protocol to your app see https://docs.microsoft.com/en-gb/windows/uwp/launch-resume/handle-uri-activation

If the app doesn't have its own custom URI Scheme then you'll have to launch it via the shell. Actually, the shell has its own scheme (helpfully called 'shell') so you can do this:

>start shell:AppsFolder\Microsoft.WindowsStore_8wekyb3d8bbwe!App

Here "Microsoft.WindowsStore_8wekyb3d8bbwe" is the PFN (Product Family Name) of the app to launch. Fortunately, these names are easy to find as there are folders with these names for each of the installed apps at "C:\Users\[username]\AppData\Local\Packages"

That folder also includes some things you can't call directly plus some folders that are actually part of other experiences so you can't use everything there.

Enjoy.

Wednesday, January 04, 2017

Tuesday, January 03, 2017