How to run a Metro-App from PowerShell on Windows 8?

后端 未结 2 512
醉梦人生
醉梦人生 2021-02-14 02:22

Related to another question on Superuser, I\'m trying to run a Metro based application from the command-line. According to a comment on my superuser question, I could maybe find

相关标签:
2条回答
  • 2021-02-14 02:46

    There is no direct way to do this but there are a couple indirect ways.

    vsdebuglaunchnotify, which comes with Visual Studio, can be called from PowerShell.

    You could create your own exe that uses IApplicationActivationManager.

    If the app is associated with any file types you could launch an associated file.

    More information is covered in this thread on MSDN:

    http://social.msdn.microsoft.com/Forums/en-US/windowsgeneraldevelopmentissues/thread/8d1b0861-5903-4289-8cb8-541ddaa012fb

    0 讨论(0)
  • 2021-02-14 03:07

    Here's a blog post by Powertoe that uses the IApplicationActivationManager way of doing it:

    http://powertoe.wordpress.com/2012/11/02/get-a-list-of-metro-apps-and-launch-them-in-windows-8-using-powershell/

    He provides code here http://poshcode.org/3740 that provides a Start-MetroApp commandlet for powershell.

    Alternatively: I think some Metro Apps have protocol handlers, so that you can talk to them via a URI (e.g. "appname:dosomething") but I'm not sure how widely used this is.

    0 讨论(0)
提交回复
热议问题