Launch UWP apps via URI Scheme

If you ask how to launch a UWP app from the command line, you have to learn new ways.

The common way to launch a UWP app is

Protocol activation via URI

There are a number of built in URIs to launch the default app for things like mailing, etc.

URI Scheme Launches
bingmaps:, ms-drive-to:, and ms-walk-to: Maps app
http: Default web browser
mailto: Default email app
ms-call: Call app
ms-chat: Messaging app
ms-people: People app
ms-settings: Settings app. You can also jump to specific areas, like ms-settings:privacy-webcam
ms-store: Store app
ms-tonepicker: Ring/Alarm Tone picker
ms-yellowpage: Nearby Numbers mobile app
ms-clock: Alarm/Clock (does not work for me)
ms-actioncenter: Action/Notification Center
ms-cortana Cortana
onenote: Default Onenote app
xbox-tcui: Xbox app
ms-cxh: Microsoft Account Profile
microsoft-edge: Edge Browser
read: Edge Reading View (does not work for me)
bingnews: Bing news app

Launching a modern app from the command line

To start the corresponding default app from the terminal (cmd.exe) precede each URI command with start, like this

  >start microsoft-edge:

You can also right-click on the Start button, choose Run (or press Win+R), enter the URI command (without preceding start), and press Enter.

Run-ms-clock

Apart from command line junkies, protocol activation is most useful in your own handmade apps. Because your app can’t select the app that is launched. If there is no app installed to handle the given URI, you can recommend an app for the user to install. For more info, see Recommend an app.

Protocol activation should also work for most 3rd-party apps. If you know the declared (metro/uwp) app name, you can launch the app like this:

twitter:

wunderlist:

Sad to see that some apps have wired internal names like test_uwp_app123:

To use protocol activation for your own app read: Automate launching Windows 10 UWP apps

Many apps also accept additional URI parameters like mailto:your@email.com?subject=Important message
or bingmaps:?cp=40.726966~-74.006076

Alternatives

If this does not work for a specific app, there are some alternatives:

GUI automation with VBS

Someone on stack overflow suggested here to use a VB-Script to automate the UI. It’s kinda ugly, but maybe still useful.

Set objShell = WScript.CreateObject("WScript.Shell")
objShell.SendKeys "^{ESC}"
WScript.Sleep 1000
objShell.SendKeys WScript.Arguments.Item(0)
WScript.Sleep 1000
objShell.SendKeys "{ENTER}"

Save this to a vbs script, let’s say metrorunner.vbs and run in command line:

>metrorunner.vbs store

Create a Desktop Shortcut

Another option is navigating to the (Modern) App Folder and create a regular Shortcut on your Desktop, as described here.

Win+R: shell:AppsFolder

Then, pick the app you want, right-click, select create a shortcut, and you will be asked if you would like to create one the Desktop.

Not bad. I have to admit I like that special folder for reference purpose, since is gives you an overview of all your installed apps.

That’s all for now.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s