terminal: WT command in Windows Explorer does not work anymore
Environment
Windows build number: Win32NT 10.0.19041.0 Microsoft Windows NT 10.0.19041.0
Windows Terminal version (if applicable): 1.1.2021.0
Any other software?
Steps to reproduce
Open Windows Explorer in any directory. Enter wt in the “adress bar”, and press “Enter”.
Expected behavior
The Windows Terminal opens in the current directory.
Actual behavior
An error message appears “Windows cannot access the specified device, path, or file. You may not have the appropriate permissions to access the item”.
When looking in the Windows App directory, there is no path corresponding to the error title, instead ther is a folder Microsoft.WindowsTerminalPreview_2020.720.2337.0_neutral_~_8wekyb3d8bbwe
.
Maybe there is an error in the directory name.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 15
- Comments: 34 (8 by maintainers)
@long-nguyenxuan

@PrOF-kk you’ll need to use
wt -d .
to getwt
to start in the current working directory.I need to disable and enable alias after latest terminal update, because it couldn’t find when running wt from explorer path input 😕
Im having this problem but its a different error and nothing in this issue solved it. I don’t have preview installed
Any ideas?
When i run from the start menu it works fine, its just when i try to run using
wt.exe
It also ran fine before, it started doing that a few days agoI can reproduce with Windows Terminal 1.1.2021.0 and Windows Terminal Preview 1.2.2022.0 on Windows 10 version 2004 (OS Build 19041.388):
wt.exe
app execution alias of Windows Terminal Preview, thenwt
in File Explorer starts Windows Terminal Preview. ✔wt.exe
app execution alias of Windows Terminal, thenwt
in File Explorer shows the access-denied dialog box. ❌wt.exe
app execution aliases, thenwt
in File Explorer shows the access-denied dialog box. 🙄 In this case though, I shouldn’t expectwt
to work anyway.When I install Windows Terminal Preview, AppXSvc creates the following Registry keys:
Those Registry keys stay there when I enable or disable the
wt.exe
app execution aliases. They seem related to https://github.com/microsoft/terminal/issues/6748 and https://github.com/microsoft/terminal/pull/6860. If I rename the Registry keys, then the results change:wt.exe
app execution alias of Windows Terminal Preview, thenwt
in File Explorer runs Windows Terminal Preview. ✔wt.exe
app execution alias of Windows Terminal, thenwt
in File Explorer runs Windows Terminal. ✔wt.exe
app execution aliases, thenwt
in File Explorer openshttp://wt/
in my Web browser. 🙄If I disable the
skype.exe
app execution alias and typeskype.exe
in the Windows+R run box or in the File Explorer address bar, then I get a similar access-denied dialog box, so this is not specific to Windows Terminal.If Windows needs a Registry key in App Paths, then perhaps it should keep the per-user key always synchronized with the app execution aliases, and not create the per-machine key.
I cannot reproduce in 1.1.2233.0, but Windows Terminal always opens in
C:\Users\%USERNAME%
directory regardless of where explorer is openedNote: cmd.exe set as default profile
Typing
wt
does not work for me in Run (Start+R) or Windows Explorer, but it does work when I typewt
in cmd. Disabling and enabling the alias in alias settings had no effect.Toggling “Windows Terminal” under Application Aliases as @zadjii-msft pointed out fixed my issue of not being able to launch wt.exe.
Also experienced this from a recent update and this solution worked for me.
As explained above by Kalle, the path is defined in the registry keys for “App Paths”. There was a discrepancy where the path pointed to a previously installed version of wt
C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.8.1444.0_x64__8wekyb3d8bbwe>
when actually the app was updated so the correct path would beC:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.8.1521.0_x64__8wekyb3d8bbwe>
. Re-enabling wt.exe under ‘App execution aliases’ settings fixed it.@stmax82 You might already know this, but to get the behavior you want, you can do one of:
wt -d .
wt --startingDirectory .
wt new-tab -d .
wt new-tab --startingDirectory .
These all mean exactly the same thing.
-d
is an alias for-startingDirectory
, andnew-tab
is the default argument towt.exe
, when the user does not provide an argument.^^ this was quite a helpful clue, @haydenmc
I have both Windows Terminal Preview and Windows Terminal, both installed via the store.
wt -d .
from the address bar in Windows Explorer was broken completely, with the same error dialog from Windows Terminal Preview in the original post. I have the preview installed, but I’m not using it at the moment. I was trying to invoke vanilla Windows Terminal.The settings in the “App Execution Aliases” panel looked right. The one for Windows Terminal was turned on, and the one for Windows Terminal Preview was turned off.
But when I checked under
HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths
, andHKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths
,I saw that Windows Terminal Preview was “hogging the spotlight” by having it configured under HKEY_CURRENT_USER. So, I renamed it from
wt.exe
towtp.exe
, just so that it wouldn’t interfere with my use ofwt -d .
from the Windows Explorer address bar to invoke vanilla Windows Terminal. (Windows Terminal Preview is still broken in this regard, but I just wanted to be able to get working again).The existing entry for Windows Terminal under HKEY_LOCAL_MACHINE was working fine, so I left it where it was. I guess these are supposed to be under HKCU now?
Caveat:
wt new-tab -d .
is broken for me; it simply launches a new copy of Windows Terminal instead of creating a new tab in an existing instance. (Perhaps it requires a single instance for thenew-tab
functionality to work? Or maybe that is only available in the Preview?)Edit: looks like @KalleOlaviNiemitalo had the analysis nailed, back at the beginning of the thread:
Maybe we should have three execution aliases:
wt.exe
,wtp.exe
, andwtd.exe
, to keep the release, preview, and dev versions from stepping on each other?@ntindle Nope, no need. That flag is technically part of the
new-tab
command:when no command is explicitly passed to
wt
, it assumes the command to benew-tab
.