Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows Terminal's wt.exe cannot be found for non-admin user's PATH

Windows 10 with a non-admin user account.

Installed Windows Terminal from Microsoft Windows Apps. Calling wt.exe from cmd.exe can't find it. Running Windows Terminal from the Start using short-cut opens it OK.

Running wt.exe in cmd.exe from admin account opens it successfully. PATH variable has the non-admin user's relevant entry: %USERPROFILE%\AppData\Local\Microsoft\WindowsApps which has wt.exe in it. Clicking on it in Explorer opens Windows Terminal.

Outputs of where and echo from within cmd.exe:

C:\Users\sr>wt
'wt' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\sr>where wt
INFO: Could not find files for the given pattern(s).

C:\Users\sr>echo %USERPROFILE%
C:\Users\sr

How do I open Windows Terminal from cmd.exe using wt.ext from non-admin account?

Edit: all commands are run from within cmd.exe
Edit 2: wt.exe also fails to launch from Powershell, both standard and admin: standard:

PS C:\Users\sr> wt
wt : The term 'wt' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name,
or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ wt
+ ~~
    + CategoryInfo          : ObjectNotFound: (wt:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

admin

PS C:\WINDOWS\system32> wt
Program 'wt.exe' failed to run: The file cannot be accessed by the systemAt line:1 char:1
+ wt
+ ~~.
At line:1 char:1
+ wt
+ ~~
    + CategoryInfo          : ResourceUnavailable: (:) [], ApplicationFailedException
    + FullyQualifiedErrorId : NativeCommandFailed

Edit 3: in cmd.exe, typing full path to wt.exe launches it OK: C:\Users\sr>C:\Users\sr\AppData\Local\Microsoft\WindowsApps\wt.exe

like image 232
user3156459 Avatar asked Aug 07 '20 14:08

user3156459


People also ask

How do I fix wt exe not found?

The "Windows can't find 'wt.exe'" error message prevents you from using one of Windows 11's best command-line tools: Windows Terminal. Reinstalling the app, making sure it is on, and running an SFC scan can eliminate the problem. And if all else fails, try reinstalling Windows 11.

What is WT exe?

You can use wt.exe to open a new instance of Windows Terminal from the command line. You can also use the execution alias wt instead.

Where is Windows Terminal install location?

The path for your Windows Terminal settings. json file may be found in one of the following directories: Terminal (stable / general release): %LOCALAPPDATA%\Packages\Microsoft. WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.


2 Answers

TLDR: Try opening the App execution aliases settings page in Windows 10 and toggle the switch for Windows Terminal off and then back on again.

I'm not sure if this is exactly the same issue as in the original question, but I randomly just had issues with the wt command not working (either when I typed it into the Start Menu and pressed enter, or when I typed it into the address bar of File Explorer to try to open a terminal in the current directory). If I manually clicked Windows Terminal in the start menu or opened the Microsoft Store page for it and clicked the "Launch" button, then it would work. My path environment variable was in order and I didn't have the Windows Terminal Preview installed---just Windows Terminal.

After Googling around some, I found something that mentioned the "App execution aliases" settings page in windows 10. I opened that and toggled the switch off, at which point I saw the %USERPROFILE%\AppData\Local\Microsoft\WindowsApps\wt.exe file disappear. Then I toggled it back on and wt.exe reappeared in that folder. After doing that, everything works fine again.

like image 168
Brandon Avatar answered Oct 09 '22 01:10

Brandon


Try adding an environment variable for your Path, let the value be:

%USERPROFILE%\AppData\Local\Microsoft\WindowsApps

like image 32
apena Avatar answered Oct 09 '22 03:10

apena