terminal icon indicating copy to clipboard operation
terminal copied to clipboard

Access Denied running wt.exe and failing to startup on boot

Open n614cd opened this issue 1 year ago • 6 comments

Windows Terminal version

1.18.3181.0

Windows build number

10.0.22631 Build 22631

Other Software

No response

Steps to reproduce

  1. Install WindowsTerminal.
  2. Crash Windows (video driver problem).
  3. WindowsApp folder has corrupt ACLs. Fix per knowledge MS base (takeown cacls) using MS support.
  4. All apps working fine except WindowsTerminal. Now getting "access denied" when attempting to execute "wt -w 0 nt --title "Java" -d %CD%"
  5. Re-install WindowsTerminal No change.

Expected Behavior

Open a new tab

Actual Behavior

Access Denied error message

n614cd avatar Feb 01 '24 18:02 n614cd

I managed to get WindowsTerminal to work correctly. But he issue points to something likely being left behind somewhere when uninstalling/reinstalling. If I enable "Terminal" in the Startup Apps. I get access denied in the terminal; but the terminal opens. If I run the WindowsTerminal application via the start menu. Nothing happens. Task Manager briefly shows the app starting and then it disappears. If I run "wt" via the start bar, everything works as expected.

Note: There are multiple names in play. Terminal, WindowsTerminal and wt.

n614cd avatar Feb 01 '24 19:02 n614cd

same issue occurring for me after update

adham-elaraby avatar Feb 01 '24 19:02 adham-elaraby

WindowsApp folder has corrupt ACLs. Fix per knowledge MS base (takeown cacls) using MS support.

image

Literally any time someone does this, it's unfixable. It's going to seriously mess up your system.

A small recent sample:

  • https://github.com/microsoft/terminal/issues/13622#issuecomment-1202718325
  • https://github.com/microsoft/terminal/discussions/13511
  • https://github.com/microsoft/terminal/issues/16419#issuecomment-1839009663

For example, in this case: the OS specifically hits an Access Denied the first time it tries to open ...WindowsApps/.../wt.exe, and that access denied actually lets the OS know to do the right thing and re-try the exe as a packaged application (which then does work). If you instead grant permissions to wt.exe, then the first E_ACCESSDENIED never happens, and you get into all sorts of undefined behavior.

NEVER mess with the permissions anywhere on WindowsApps!

zadjii-msft avatar Feb 02 '24 12:02 zadjii-msft

@zadjii-msft

Well, in this case, I did what I was told too by MS Support. After a series of power failures that took out my UPS, I had corrupt ACLs on the WindowsApps folder.

What do you think is the correct way to fix ACLs when they are showing as corrupt?

Tim

n614cd avatar Feb 02 '24 15:02 n614cd

I honestly don't know. What I do know, is to never ever ever touch them. I've only ever heard of folks having to straight-up reinstall Windows to fix it.

zadjii-msft avatar Feb 02 '24 15:02 zadjii-msft

Yeah, I also had to learn this the hard way, for now just running the portable version of Windows Terminal, and reinstalled all my WSL distros

adham-elaraby avatar Feb 02 '24 16:02 adham-elaraby