从 PowerShell 启动 WinRT 应用程序 [英] Launching WinRT app from PowerShell
问题描述
我有一个需要用脚本启动的 Windows RT 应用程序.我已经使用 PowerShell 在设备上安装了该应用程序,但我需要使用 PowerShell 或命令提示符启动该应用程序.有没有办法做到这一点?谢谢.
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.
附言看起来有一种方法可以使用 Start-MetroApp 命令在 Windows 8 上启动 Metro 应用程序,但这在 Windows RT 上不起作用.Windows RT 是否有某种等价物?
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?
推荐答案
你可以使用协议激活,如果你想让你的应用程序让任何人都可以从资源管理器、运行、powershell 或 cmd 中打开它
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
这是协议激活的 MSDN 示例.
Here's MSDN sample of protocol activation.
这是启动应用程序的方法.
Here's the way to launch the app.
对于运行和资源管理器:myapp://
For run and explorer : myapp://
对于 cmd 和 power shell:explorer.exe myapp://
For cmd and power shell : explorer.exe myapp://
此外,阅读这篇很棒的博客文章,进程间通信(Windows 商店应用程序和桌面应用程序)与 WinRT 中的协议关联
Moreover, read this awesome blog post, Inter-Process communication (Windows Store App & Desktop Apps) with protocol association in WinRT
这篇关于从 PowerShell 启动 WinRT 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!