2

Background

I can run this UWP application by running the following:

test://argument=123?other=true

This would run the UWP application that is linked to the test:// protocol and the application would automatically take that argument=123?other=true, parse it and perform the actions specified by those parameters.

Desired outcome

However, I would like to run the application without using any protocol and directly via the executable.

What I've tried

So far, I've came up with the following:

"C:\Program Files\WindowsApps\PackageId\Windows10Universal.exe" -ServerName:ActivatableClassId

This does not pass in the parameters so it doesn't automatically perform what I would like it to. I have tried the following but it does not work either:

"C:\Program Files\WindowsApps\PackageId\Windows10Universal.exe" -ServerName:ActivatableClassId "argument=123?other=true"

I've also tried to investigate by using Process Monitor and Process Explorer to see what Windows is doing behind the scenes but I can't seem to find out.

Stefanuk12
  • 31
  • 1
  • 4

1 Answers1

2

Calling a UWP/Modern app with arguments is discussed in the article
How to Open a Windows Modern UWP App From the Command Line.

You need three items of information about the app :

  • Package Name
    This is the name of the folder where the app is located (not the full path), for example:

    C:\Program Files\WindowsApps\microsoft.windowscommunicationsapps_16005.12827.20560.0_x64__8wekyb3d8bbwe
    
  • Publisher ID
    This is the weird string at the end of the path, for example 8wekyb3d8bbwe

  • Application ID
    In the above folder, open the file AppxManifest.xml and find the executable name in an XML element that looks like this:

    <Application Id="microsoft.windowslive.calendar" Executable="HxCalendarAppImm.exe" EntryPoint="Executable">
    

To call the app you need to compose the string

shell:AppsFolder\<Package Name>_<Publisher ID>!<App ID>

To pass parameters to the executable, use the Windows start command.

For example, to launch Windows Terminal from the command line and open a specific profile, use:

start "" shell:AppsFolder\Microsoft.WindowsTerminal_8wekyb3d8bbwe!App new-tab -p "GitBash"

Note that the above command-line won't work without the start command.

harrymc
  • 498,455