🄍

Set Store apps as the default for arbitrary file types in Windows 10

Windows won’t let you open arbitrary files with apps installed from the Microsoft Store unless it knows the app can handle the file type. App developers provide information about supported file extensions and protocols when they submit the app to the store. Windows 10 doesn’t make it easy for power users to override this list. Here’s the least painful way to do it.

It should be as easy as right-clicking on a file and choosing Open With, and selecting the program you want to use. However, Open With (that’s the name of the program that lists programs and handles file associations) won’t list programs that haven’t registered a file association.

Traditionally, you’ve been able to use Open with and choose to Look for another app on this PC. This will bring up a file chooser dialog where you can choose what program to run. Locating the right program on disk isn’t easy unless you’re familiar with where they’re typically installed. Locating a Store app is practically impossible.

By default, Microsoft Store apps install into a folder at %ProgramFiles%\WindowsApps. This is a special protected system folder that not even administrative users have access to. You can find tutorials showing you how to access it, but this requires that you remove the security locks entirely. However, don’t need to access this folder directly, so you should leave its security protections in place.

Some Store apps, such as the Kate text editor and Okular document reader, create app execution aliases. App execution aliases add an app’s preferred executable file name into the PATH variable on Windows. Anything in the PATH can be launched from the Run dialog, Terminal, PowerShell, or even the File Explorer location bar. The aliases are added to the %LOCALAPPDATA%\Microsoft\WindowsApps folder. The folder can be accessed by a regular user without modifying any security policies.

To be honest, I don’t know what dark magic or system calls are involved in getting app aliases to run. The aliases aren’t regular Windows shortcut files (.LNK) or file system junctions. They’re zero byte files with no special file system attributes or anything out of the ordinary. You can run them and launch their associated programs through the Start Process system call, but no other method works (such as double-clicking on the executable file).

Update (): Windows finds app aliases because of App Path registrations. These registrations won’t help Open With find the app, though. I still don’t know the purpose of the 0-byte executable files.

The file chooser can show you a list of installed programs, including Store apps, by typing shell:AppsFolder into the location bar and hitting enter. In theory, that’s how it should work. While this works in the File Explorer, this path won’t list any installed programs in the file chooser dialog.

You can make shortcuts to Store apps by dragging them out of the shell:AppsFolder and onto the Desktop. Unfortunately, Open With is finicky and also won’t let you choose to open files with a shortcut (.LNK) file (even when it points to an executable). At this point, we’re starting to run out of options. Maybe compromising the system’s security measures isn’t such a bad idea after all?

So far, I’ve only reiterated things that should have — but doesn’t work. It’s time to move on to a solution that will work. Here’s how to make Store apps appear in the Open With menu. This also lets you set them as the default app for a given file type.

  1. Start the program you want to use to open your file.
  2. Open the Task Manager (search for it in the Start menu).
  3. Click More details at the bottom if it opens in simplified/compact mode.
  4. Find your program in the list and double-click to expand it.
  5. Right-click on the main process entry in the expanded list. It’ll have the same icon and name as the program, and will be near the top of the list.
  6. Choose Open file location
  7. Select the path in the navigation bar and copy it.

You can see from the path that you’re now in a folder inside the protected %ProgramFiles%\WindowsApps folder. You should see a program file in the folder list. If you’re uncertain about which file it is, then repeat steps 5–6 and Windows will highlight it for you.

  1. Find the file you want to open in a File Explorer window.
  2. Right-click it and choose Open with or Open with: Choose another app.

If nothing happens at this step, then please take a minute to curse Microsoft for how buggy Windows 10 is. This is a common bug since Windows 8. You’ll need to log out and back in again. If you’re comfortable with the terminal, you can instead run the command openwith.exe c:\path\to\your.file.

  1. Scroll to the bottom of the list of apps, and choose More apps.
  2. Scroll to the bottom of the expanded list and select Look for another app on this PC.
  3. This opens a file chooser. Paste the path you copied in step 7 into the navigation bar and press Enter.
  4. Select the program file (the one that got highlighted in step 6), and click OK.

And you’re done! Maybe. Windows sometimes set the program you’ve selected as the default for the file type after completing the above process. For example, Windows refuses to change a class of protected file type (including .HTML and .PNG) using the above method. Here’s how to change the default type when Windows is stubborn.

  1. Select a file of the type you want to open, e.g. a .PNG file, in the File Explorer.
  2. Right-click on the file and choose Properties.
  3. Under Opens with, click Choose.
  4. Repeat steps 10–13.
  5. Click Apply.

Because Windows is a well-written operating system without any bugs, you shouldn’t have any more issues getting it to use your preferred programs. Unless it resets the file associations after you reboot the system or install a major feature update. Unfortunately, this is a common problem. If this only happens to one type of files, then the following method should work:

  1. Repeat the above procedures to set your preferred program as the default for a file type.
  2. Open the Windows Settings app: Apps: Default apps, and select Choose defaults by file type.
  3. Locate the file type in question in the list. It should show your preferred program. If not, then repeat steps 14–18, close the Settings app, and retry from step 19 onward.
  4. Click on the app name next to the file type in question in the list.
  5. The expanding list won’t include your current choice, and this is fine. The list only displays apps Windows knows can handle the file type (as discussed above).
  6. Press the Escape key.
  7. Close the Settings app.

The above steps may seem a bit meaningless, but it makes Windows save your preferences. It often fixes this type of problem. If it doesn’t work or if it affects multiple apps and file types, then your file and protocol association registry may have been corrupted Your best bet is to reset the database, reboot, and try again. Note that you’ll need to reconfigure all file types and preferences such as the default web browser after resetting it.

  1. Open the Windows Settings app: Apps: Default apps, and click Reset.
  2. Reboot your computer.
  3. Repeat everything from step 1 onward.

I hope we’ve got everything sorted out by now. Now is a good time to consider leaving Windows behind and switching to Linux or MacOS instead. The simple operation of opening and assigning default programs to handle files is something every other operating system does better than Windows.

I hope that one day, Microsoft will just rip out everything related to file and protocol associations and start over. This foundational part of Windows was poorly designed and has been broken and prone to all sorts of weird failures since at least Windows 95.