1

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
  • 21
  • 3

1 Answers1

1

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
  • 455,459
  • 31
  • 526
  • 924
  • I'm trying to pass "protocol" arguments which are different. I've tried to apply your logic and while the application launches, it does not acknowledge the arguments. Note that `test://argument=123?other=true` provides the desired outcome. Here's what I have tried: `start "" shell:AppsFolder\PackageName_PublisherId!App "argument=123"` – Stefanuk12 Jul 23 '23 at 17:23
  • Try `start "" shell:AppsFolder\PackageName_PublisherId!App 123`. – harrymc Jul 23 '23 at 17:26
  • Note that this requires that the app be programmed to examine its arguments. – harrymc Jul 23 '23 at 17:40
  • Unfortunately, this doesn't work. It seems like it must be done through the protocol. – Stefanuk12 Jul 23 '23 at 18:25
  • This app is then not looking at the command-line arguments, only looking at the URL. There is no solution, except if you can modify it to accept arguments. – harrymc Jul 23 '23 at 18:52