4

I have a number of different apps installed on my Windows 10 computer that use the App Execution Aliases feature (Settings -> Apps and Features -> App Execution Aliases). However, with the exclusion of Windows Subsystem for Linux (WSL), none of these aliases work. I have tried launching them (by typing in the alias name) with:

  • Powershell
  • Command Prompt
  • New Windows Terminal
  • Run Menu

Below is an image of the App Execution Alias menu enter image description here

Edit: To clarify what happens when it does not work:
When I type in the app execution alias (Example: Spotify.exe or winget.exe) into any command prompt, I get a message that the command cannot be found.

evandrix
  • 123
  • 1
  • 4
BarrowWight
  • 688
  • 1
  • 9
  • 21
  • So what exactly happens? An error message or just nothing? – Daniel B Jul 15 '20 at 19:07
  • This lists `shell:` folders. Paste into command prompt. `(@For /f "tokens=1* delims=" %A in ('reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions /f name /v name /s ^| findstr /c:"Name" ^| Sort') Do @Echo %A) & pause` ---- This lists Modern App URLs - a way of starting them no matter what the version is. `(@For /f "tokens=1* delims=" %A in ('reg query HKCR /f "URL:*" /s /d ^| findstr /c:"URL:" ^| findstr /v /c:"URL: " ^| Sort') Do @Echo %A %B) & pause` – Mark Jul 15 '20 at 23:14
  • This list app you can start by typing their name in Run dialog or by using command prompt's `Start` command. `(@For /f "tokens=7* delims=\" %A in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths" /f "*" /k') Do @Echo %A) & pause` – Mark Jul 15 '20 at 23:15
  • @DanielB I have updated the question with details about why it does not work. – BarrowWight Jul 16 '20 at 20:38
  • Please check whether you have in `%PATH%` the following path: `C:\Users\\AppData\Local\Microsoft\WindowsApps`. It’s near the end of the list for me. – Daniel B Jul 16 '20 at 20:57
  • @DanielB I do not see it on my path (how odd, I don't ever delete anything in my path). Would you recommend putting it in the system environment variables PATH, or the user environment variables PATH? Also, please post as an answer so that I can upvote it. – BarrowWight Jul 16 '20 at 21:26
  • Ah, in case it wasn't clear, you need to check the effective value, not the control panel settings. Something like `echo %PATH%` in Command Prompt. It is added automatically by Windows. (It's no an answer yet.) – Daniel B Jul 17 '20 at 06:40
  • @DanielB So It was not in the path settings, I added it in to my user path, and it works now. – BarrowWight Jul 17 '20 at 06:44

2 Answers2

4

App aliases are stored in %USERPROFILE%\AppData\Local\Microsoft\WindowsApps

This can be verified using the where command:

C:\Users\Daniel>where spotify
C:\Users\Daniel\AppData\Local\Microsoft\WindowsApps\Spotify.exe

By default, this is the single entry in the per-user %PATH% environment variable:

enter image description here

(Only had a German VM with a clean account at hand.)

If, for whatever reason, this entry is missing, you can easily add it again. Remember to add it to the “User variables” section’s %PATH% variable (usually visible as “Path” in the list). Some program installers mess with this list to add themselves to it. It doesn’t always end well.

Daniel B
  • 60,360
  • 9
  • 122
  • 163
  • can you help with a similar issue on Windows 2019? I have the correct %path% and can call the alias, but it seems to try to run the zero-length file of the alias returning an error that the app is not supported. The exe works if copied elsewhere and the same package works fine on Win 10. I posted it as https://stackoverflow.com/questions/67495731/how-do-i-make-an-execution-alias-work-on-windows-server-2019 – max May 16 '21 at 09:18
  • 1
    I had to go to "Manage app execution aliases" and disable and re-enable it to get it working again for Windows Terminal (`wt`). – 0xC0000022L Jun 28 '21 at 13:28
  • 1
    @0xC0000022L, thanks, that fixed it for me. Was working fine last week, then suddenly the python3 command opened the app store instead of running the version that was already installed via the app store. – pavon Oct 25 '22 at 16:51
  • My app execution aliases were not saved. I closed the window, reopened it and my changes were gone. Removing Python 3 installation, manually cleaning leftover files (python.exe, python3.11.exe and python3.exe), and installing it again from Windows Store fixed the issue for me. – Alexandr Zarubkin Mar 14 '23 at 10:33
1

I was getting this same error while trying to open Terminal as an admin with a separate account.

In order fix it in my case, the admin account needed to have its path for terminal set to the non-admin's app data path.

Austin
  • 11
  • 2