Opening a file in a Metro app from command line

Sora. picture Sora. · Oct 7, 2014 · Viewed 7.7k times · Source

I need a way to open a file in a Metro app from command line.

So far I've figured out how to start the app from command line without any third-party scripts

explorer shell:AppsFolder\Microsoft.Reader_8wekyb3d8bbwe!Microsoft.Reader

but I haven't been able to figure out how to include a file name yet.

Launching

explorer shell:AppsFolder\Microsoft.Reader_8wekyb3d8bbwe!Microsoft.Reader example.pdf

just opens up a default explorer window.

Any idea from Windows 8 experts on how to accomplish this without any third-party tools/cmdlets/etc.?

Note: In fact I'm using Windows 10 but I guess if there's a Windows 8 / 8.1 way to do it, it'll work for 10, too.

Answer

Kevin picture Kevin · Apr 9, 2015

If you're still looking for the answer, the best way to open a file in a metro app is to use an execution string like a normal app protocol does. The execution string looks like this:

bingnews:[arguments, can be left blank.]
microsoftvideo:[arguments, can be left blank.]
netflix:[arguments, can be left blank.]

So, to start up netflix, it's as simple as typing in Start netflix: into the command line.

To find the execution string for an app, go here: Control Panel\Programs\Default Programs\Set Associations


More info and examples can be found here.

http://windowsitpro.com/windows-8/opening-windows-8-apps-command-prompt-or-script

http://www.itsjustwhatever.com/2012/10/28/launch-windows-8-metro-apps-from-a-desktop-shortcut-or-command-line/


PLEASE NOTE: To open an app WITHOUT A PROTOCOL (One not listed in the registry or under "Set Associations") use OP's method:

explorer shell:AppsFolder\[appuid]![appfullname]

The app UID is the folder name without the version number. For example,

4DF9E0F8.Netflix_2.11.0.8_x64__mcm4njqhnhss8

becomes

4DF9E0F8.Netflix_mcm4njqhnhss8

The app fullname is the [App author].[App name] For example, 4DF9E0F8.Netflix. 4DF9E0F8 is the author, and Netflix is the name.

Put it all together to get

explorer shell:AppsFolder\4DF9E0F8.Netflix_mcm4njqhnhss8!4DF9E0F8.Netflix