TransWikia.com

Why does the .exe file of a Modern App fail to run and produces an error regarding the app container?

Super User Asked by Teo Zec on November 29, 2021

Inside the C:Program FilesWindowsApplications folder there are the .exe files for the Modern Apps on my PC. When I double-click on one of them, a pop-up tells me:

This application can run only in the context of an app container

Is there a way to run a Modern app directly from its .exe file, and not only by its tile?

Thank you in advance!

P.S.: I’m on Windows 10 technical preview.

3 Answers

You can run a Windows modern app from the command line using an explorer.exe shell command like this:

explorer.exe shell:AppsFolder<Package Name>_<Publisher ID>!<App ID>

Or, via start, which is recommended if you need to pass arguments:

start shell:AppsFolder<Package Name>_<Publisher ID>!<App ID> arg1 arg2

The trick is discovering the Package Name, Publisher ID, and App ID. It would be nice if all this info were available on the Microsoft Store listing for the app, or in Task Manager, or on the app's listing in Settings -> Apps & features. So far, I have found no easy way to collect those three pieces of information. Here are steps to do so using Task Manager and File Explorer, copied from my blog post.

  1. Open the modern app as you normally would, from the Start menu, task bar, etc.
  2. Launch Task Manager (I right-click on the Windows task bar and choose "Task Manager")
  3. Expand the listing for the app you're interested in, right-click on the child item, and choose "Go to Details"
  4. Right-click on the highlighted executable and choose "Open file location"
  5. The name of the directory you just opened gives you the Package Name and the Publisher ID, if you know how to parse them out. Using the Calendar app as an example, the directory name, "microsoft.windowscommunicationsapps_16005.12827.20560.0_x64__8wekyb3d8bbwe", starts with the Package Name ("microsoft.windowscommunicationsapps"), is followed by version and platform information that you don't need for this ("16005.12827.20560.0_x64"), and then comes the Publisher ID ("8wekyb3d8bbwe"). Note the Package Name and Publisher ID for later use.
  6. Open the AppxManifest.xml file in that directory
  7. Near the top of the AppxManifest.xml file, you'll find an Identity element, with a Name attribute -- confirm that this value matches the package name, which we already got from the directory name
  8. Search the AppxManifest.xml file for the executable name, e.g., HxCalenderAppImm.exe, and you'll find an XML element that looks like this:
This gives you the third piece of information you need: the Application ID.

Now that you've collected the three pieces of information we need, you can build the command to open the app from the command line.

  1. Your command will look like this, replacing the portions with the three pieces of information collected above:

    explorer.exe shell:AppsFolder<Package Name>_<Publisher ID>!<App ID>

Continuing with the example of the Calendar app from the Mail and Calendar package, you would enter something like this:

explorer.exe shell:AppsFoldermicrosoft.windowscommunicationsapps_8wekyb3d8bbwe!microsoft.windowslive.calendar

Dear Microsoft: Please make this easier!

Answered by Mark McClelland on November 29, 2021

I believe that it is possible now, at least in some way. The "Windows Scan" application for example can be turned into a shortcut using "Microsoft.WindowsScan_8wekyb3d8bbwe!App" as the target.

Answered by xaml on November 29, 2021

Prior to Windows 8, you could have "standalone" .exe applications. Installation was mainly to create links and references to make it easy for the application to find what it needed and run. If everything the application needed was provided by the application, itself, it could run without installation. The app-container is a security concept introduced with Win 8. Without installation, an application has access to its own folders and little else, including most devices. An application must be designed to work with app-containers in order to be installed. This link has a decent description of the concept and how it works.

Edit: For an installed application, it appears that all of the associations and permissions are attached to the tile, so the .exe cannot be run directly.

Answered by fixer1234 on November 29, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP