2

I know you can use the Get-AppxPackage and Get-AppxPackageManifest cmdlets in Powershell to get the package family and it's specific application entry point.

In this example with Windows Media Player (which is internally called Zunemusic, a relic from back when Microsoft competed with the iPod), the following gives us the package family name.

(Get-AppxPackage Microsoft.ZuneMusic).PackageFamilyName
Microsoft.ZuneMusic_8wekyb3d8bbwe

And it has one application called Microsoft.ZuneMusic

 (Get-AppxPackage Microsoft.ZuneMusic | Get-AppxPackageManifest).Package.Applications.Application

Id             : Microsoft.ZuneMusic
Executable     : Microsoft.Media.Player.exe
EntryPoint     : Microsoft.Entertainment.Music.App
VisualElements : VisualElements
Extensions     : Extensions

A similar example with the Clipchamp application

(Get-AppxPackage Clipchamp.ClipChamp).PackageFamilyName
Clipchamp.Clipchamp_yxz26nhyzhsrt
(Get-AppxPackage Clipchamp.Clipchamp | Get-AppxPackageManifest).Package.Applications.Application

Id             : App
Executable     : Clipchamp\Clipchamp.exe
EntryPoint     : Windows.FullTrustApplication
VisualElements : VisualElements
Extensions     : Extensions

And I can start those applications easily using explorer.exe shell:appsFolder\<package family name>!<app>, but I can't seem to pass arguments to either application. Using the following:

explorer.exe shell:appsFolder\Clipchamp.Clipchamp_yxz26nhyzhsrt!App "C:\tmp\test.mp4"

start shell:appsFolder\Microsoft.ZuneMusic_8wekyb3d8bbwe!Microsoft.ZuneMusic C:\tmp\test.mp4

I've tried variations of using start vs explorer.exe as well as quoting and not quoting the argument. Surely these applications do take in file arguments somehow? I can right click in Explorer and use Open With to launch the application with a specific file, but I need to do this programmatically in one of my applications. How to I launch one of these applications from the command line and provide it a file argument?

4
  • These apps behaviors are ruled by their manifest (for example C:\Program Files\WindowsApps\Microsoft.ZuneMusic_11.2509.7.0_x64__8wekyb3d8bbwe\AppxManifest.xml in general they don't take arguments, they can be activated by various ways (or not), protocol for example mswindowmusic:(reddit.com/r/windowsphone/comments/6kixvo/…) in media player case. Commented Nov 20 at 16:33
  • Interesting. It looks like (Get-AppxPackage Microsoft.ZuneMusic | Get-AppxPackageManifest).Package.Applications.Application.Extensions.Extension.Protocol can get a list of protocols. But I can't find much other documentation on this. I can run start mswindowsmusic://, but I can't find information on how to pass a file to open. The AppManifest.xml just describes it as a windows.protocol. How does Explorer pass the file via Open With. Surely there's got to be a standard and programmatic way to open FileA.mp4 with ApplicationX? Commented Nov 20 at 17:09
  • At least potentially a protocol-based invocation accepts an argument, e.g., for Microsoft Edge: Start-Process 'microsoft-edge:https://en.wikipedia.org?search=wikipedia'. So it's worth trying if Start-Process mswindowsmusic:<file-url> works. Commented Nov 20 at 19:39
  • 1
    There's no standard for starting these apps. If you take Clipchamp example, the manifest (desktop4:FileExplorerContextMenus) tells you it's Clipchamp.ShellExtension.dll that will start clipchamp when using it on supported file extension. This shell extension is passed the shell items by the Shell (explorer, dialog boxes, etc.) and starts Clipchamp, using a custom undocumented command line. Note you can programmatically run this shell extension (so you can programmaticall start ClipChamp on a given file) but the story is different for every app. Commented Nov 20 at 19:59

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.