Launching WinRT app from PowerShell

淺唱寂寞╮ 提交于 2019-12-21 20:54:59

问题


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?


回答1:


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




回答2:


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.



来源:https://stackoverflow.com/questions/16025315/launching-winrt-app-from-powershell

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!