Launching WinRT app from PowerShell

2019-04-12 00:39发布

I have a Windows RT app that I need to launch with a script. I've already installed the app on the device with PowerShell, but I need to launch the app with PowerShell or the command prompt. Is there a way to do this? Thanks.

P.S. It looks like there's a way to launch Metro apps on Windows 8 with the Start-MetroApp command, but this doesn't work on Windows RT. Is there some sort of equivalent for Windows RT?

2条回答
【Aperson】
2楼-- · 2019-04-12 01:17

You can use protocol activation, if you want to make your app such that any one can open it from either explorer, run, powershell or cmd

Here's MSDN sample of protocol activation.

Here's the way to launch the app.

For run and explorer : myapp://

For cmd and power shell : explorer.exe myapp://

Moreover, read this awesome blog post, Inter-Process communication (Windows Store App & Desktop Apps) with protocol association in WinRT

查看更多
Summer. ? 凉城
3楼-- · 2019-04-12 01:26

I would look at the technique mentioned in Launch Windows 8 Metro Apps From a Desktop Shortcut or Command Line, e.g.:

explorer.exe bingnews://

It also mentions a MetroLauncher utility that will work for apps without a protocol.

查看更多
登录 后发表回答