Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WT command in Windows Explorer does not work anymore #7188

Closed
TechWatching opened this issue Aug 5, 2020 · 34 comments
Closed

WT command in Windows Explorer does not work anymore #7188

TechWatching opened this issue Aug 5, 2020 · 34 comments
Labels
Culprit-Centennial Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something Product-Terminal The new Windows Terminal. Tracking-External This bug isn't resolved, but it's following an external workitem.
Milestone

Comments

@TechWatching
Copy link

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.

image

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Aug 5, 2020
@snalexp
Copy link

snalexp commented Aug 5, 2020

I had the same issue using the Win-R run box.

It only occurred for me when both Windows Terminal and Windows Terminal Preview are installed.

Removing the Preview allows wt to work again.

@KalleOlaviNiemitalo
Copy link

KalleOlaviNiemitalo commented Aug 5, 2020

I 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):

  • If I enable the wt.exe app execution alias of Windows Terminal Preview, then wt in File Explorer starts Windows Terminal Preview. ✔
  • If I enable the wt.exe app execution alias of Windows Terminal, then wt in File Explorer shows the access-denied dialog box. ❌
  • If I disable both wt.exe app execution aliases, then wt in File Explorer shows the access-denied dialog box. 🙄 In this case though, I shouldn't expect wt to work anyway.

When I install Windows Terminal Preview, AppXSvc creates the following Registry keys:

  • HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\wt.exe
  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\wt.exe

Those Registry keys stay there when I enable or disable the wt.exe app execution aliases. They seem related to #6748 and #6860. If I rename the Registry keys, then the results change:

  • If I enable the wt.exe app execution alias of Windows Terminal Preview, then wt in File Explorer runs Windows Terminal Preview. ✔
  • If I enable the wt.exe app execution alias of Windows Terminal, then wt in File Explorer runs Windows Terminal. ✔
  • If I disable both wt.exe app execution aliases, then wt in File Explorer opens http://wt/ in my Web browser. 🙄

If I disable the skype.exe app execution alias and type skype.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.

@DHowett
Copy link
Member

DHowett commented Aug 6, 2020

@KalleOlaviNiemitalo, thanks for the investigation. I'm gonna feed this straight into the app deployment team's hands 😄

@DHowett
Copy link
Member

DHowett commented Aug 6, 2020

Tracking MSFT:28217948

@DHowett DHowett added Tracking-External This bug isn't resolved, but it's following an external workitem. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Aug 6, 2020
@vadimkantorov
Copy link

vadimkantorov commented Aug 12, 2020

Same issue with Win+R when running "wt" ("wt" works when typing into cmd.exe) (i also have WT Preview installed):

image

@long-nguyenxuan
Copy link

  • If I enable the wt.exe app execution alias of Windows Terminal Preview, then wt in File Explorer starts Windows Terminal Preview. ✔

I only need to quickly start Windows Terminal, Can you show me how to "enable the wt.exe app execution alias of Windows Terminal Preview"?

@PrOF-kk
Copy link

PrOF-kk commented Aug 20, 2020

I cannot reproduce in 1.1.2233.0, but Windows Terminal always opens in C:\Users\%USERNAME% directory regardless of where explorer is opened
Note: cmd.exe set as default profile

@zadjii-msft
Copy link
Member

@long-nguyenxuan
image
image


@PrOF-kk you'll need to use wt -d . to get wt to start in the current working directory.

@ntindle

This comment has been minimized.

@zadjii-msft

This comment has been minimized.

@haydenmc
Copy link

haydenmc commented Aug 28, 2020

I do not have Windows Terminal Preview installed, just Windows Terminal, and I started running into this.

FWIW I do not see a wt.exe key under HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths, but I do see one under HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths.

The value is set to C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.2.2381.0_x64__8wekyb3d8bbwe\wt.exe which does exist, but I do not have permissions to execute it.

wt launch error

App execution aliases

PS C:\Users\Hayden> Get-AppPackage -Name "*terminal*"


Name              : Microsoft.WindowsTerminal
Publisher         : CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US
Architecture      : X64
ResourceId        :
Version           : 1.1.2233.0
PackageFullName   : Microsoft.WindowsTerminal_1.1.2233.0_x64__8wekyb3d8bbwe
InstallLocation   : C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.1.2233.0_x64__8wekyb3d8bbwe
IsFramework       : False
PackageFamilyName : Microsoft.WindowsTerminal_8wekyb3d8bbwe
PublisherId       : 8wekyb3d8bbwe
IsResourcePackage : False
IsBundle          : False
IsDevelopmentMode : False
NonRemovable      : False
IsPartiallyStaged : False
SignatureKind     : Store
Status            : Ok

@AltitudeApps
Copy link

AltitudeApps commented Aug 29, 2020

FWIW I do not see a wt.exe key under HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths, but I do see one under HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths.

^^ 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 , and
HKLM\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 to wtp.exe , just so that it wouldn't interfere with my use of wt -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?

    Hive: HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths
Name                           Property
----                           --------
wtp.exe                        (default) : C:\Program Files\WindowsApps\Microsoft.WindowsTerminalPreview_1.3.2382.0_x64__8wekyb3d8bbwe\wt.exe
^^ was wt.exe                  Path      : C:\Program Files\WindowsApps\Microsoft.WindowsTerminalPreview_1.3.2382.0_x64__8wekyb3d8bbwe

    Hive: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths
Name                           Property
----                           --------
wt.exe                         (default) : C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.2.2381.0_x64__8wekyb3d8bbwe\wt.exe
                               Path      : C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.2.2381.0_x64__8wekyb3d8bbwe

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 the new-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:

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.

Maybe we should have three execution aliases: wt.exe, wtp.exe, and wtd.exe, to keep the release, preview, and dev versions from stepping on each other?

@haydenmc
Copy link

Received a store update for Windows Terminal today and things seem happy again for my situation.

@stmax82
Copy link

stmax82 commented Sep 9, 2020

When I enter wt in the address bar of Windows Explorer it opens wt, but in the wrong directory (C:\Users<username>). Expected behavior: The Windows Terminal opens in the current directory, like powershell and cmd do.

@AltitudeApps
Copy link

@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, and new-tab is the default argument to wt.exe, when the user does not provide an argument.

@f2l2pe
Copy link

f2l2pe commented Oct 21, 2020

Im having this problem but its a different error and nothing in this issue solved it. I don't have preview installed

image

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 ago

@KyleCrowley
Copy link

KyleCrowley commented Nov 11, 2020

EDIT: I was able to get Windows Terminal working again via a procedure I found here.


As I mentioned here, I'm also running into the same issue, and it seems many others are as well.

I installed Windows Terminal via chocolatey (I can't install via the Windows Store due to organization restrictions) a few months ago and it had been working fine until recently, as it fails to launch with the same error message that @chiniara received.

I've tried reinstalling and resetting permissions on C:\Program Files\WindowsApps, but nothing seems to be working.

@xal1983

This comment has been minimized.

@zadjii-msft

This comment has been minimized.

@blackrek
Copy link

blackrek commented Mar 8, 2021

previously I fixed it by uninstalling from store and installing via choco. after installing the preview, the problem appeared again

@DHowett
Copy link
Member

DHowett commented Mar 11, 2021

I believe that this is, in part, due to #9452. If any of you are still running into this issue, would you mind following the reporting steps over there?

@KalleOlaviNiemitalo - I reported your app paths findings to the app deployment team as mentioned above and have not heard back in some time. Discussions still unfolding I guess.

@junksheng
Copy link

when I write wt in win+r or directory, it warning me "the system can't find the wt.exe", but the wt.exe exist. and i can turn on in menu.

@viceice
Copy link

viceice commented May 30, 2021

I need to disable and enable alias after latest terminal update, because it couldn't find when running wt from explorer path input 😕

@JorgenSmith
Copy link

I need to disable and enable alias after latest terminal update, because it couldn't find when running wt from explorer path input 😕

Can confirm; that did the trick for me. (Thanks for posting about App Execution Aliases, Kalle).

I have a bat file running it linked up as Streamdeck shortcut (they're a brilliant macro launcher for dev!) and couldn't figure out why it stopped working; a reboot actually resolved it temporarily last week, then it stopped working again today.

@jogerj
Copy link

jogerj commented Jun 6, 2021

I need to disable and enable alias after latest terminal update, because it couldn't find when running wt from explorer path input 😕

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 be C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.8.1521.0_x64__8wekyb3d8bbwe>. Re-enabling wt.exe under 'App execution aliases' settings fixed it.

@viceice
Copy link

viceice commented Jun 7, 2021

For me the store updated it in background while an older version was running. Then I found this issue and tried the re-enable which works.

@jogerj
Copy link

jogerj commented Jun 7, 2021

For me the store updated it in background while an older version was running. Then I found this issue and tried the re-enable which works.

This might've been the cause for me. I've been running some scripts on wt non-stop for a couple of days until i closed wt and suddenly can't open it from run again

@JaiganeshKumaran
Copy link

wt works for me but it doesn't seem to launch in the current working directory but the Open in Windows Terminal option opens in the current working directory.

@jnyanez
Copy link

jnyanez commented Aug 9, 2021

Toggling "Windows Terminal" under Application Aliases as @zadjii-msft pointed out fixed my issue of not being able to launch wt.exe.

@liudonghua123
Copy link

Maybe you can try and check the steps on #7081 (comment).

@zadjii-msft zadjii-msft removed the Needs-Tag-Fix Doesn't match tag requirements label Apr 19, 2022
@zadjii-msft
Copy link
Member

notes from internal bug: This should have been fixed in OS build 21307, which I think should have been released in Windows 11 RTM (alas, build numbers got confusing right around then)

@zadjii-msft
Copy link
Member

Anyone who was seeing this before on Windows 10, and has since updated to Windows 11 - are you still seeing this?

@zadjii-msft zadjii-msft added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Jul 28, 2022
@ghost ghost added the No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. label Aug 1, 2022
@ghost
Copy link

ghost commented Aug 1, 2022

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@ghost ghost closed this as completed Aug 4, 2022
@Welding-Torch
Copy link

Typing wt does not work for me in Run (Start+R) or Windows Explorer, but it does work when I type wt in cmd. Disabling and enabling the alias in alias settings had no effect.

@microsoft-github-policy-service microsoft-github-policy-service bot removed the No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. label Oct 28, 2023
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Culprit-Centennial Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something Product-Terminal The new Windows Terminal. Tracking-External This bug isn't resolved, but it's following an external workitem.
Projects
None yet
Development

No branches or pull requests