4

When i'm trying to lauch WindowsTerminal via wt or wt.exe alias i get this error (0xc0000022).

I already tried next:

  • reinstall WindowsTerminal
  • "repair" and "reset" it in Setting->Apps->Apps&features->WindowsTerminal->Advanced options menu
  • mess up with rights in "C:\Program Files\WindowsApps" folder
  • tried to reset whole Windows keeping my files, and then removing everything

But i keep getting this error. Thing is that Windows Terminal itself working just fine, i can launch it through win+x shortcut menu and if I set Windows Terminal as default terminal app in "For developers" settings - cmd launches in Windows Terminal.

If i write wt.exe in explorer and hit enter - i can see in adress line that it trying to lauch terminal directly from "C:\Program FIles\WindowsApps\Microsoft.WindowsTerminal_1.11.3471.0_x64__8wekyb3d8bbwe\wt.exe", not from "C:\Users\<username>\AppData\Local\WindowsApps\wt.exe" as it should.

With ProcessMonitor i looked closely and find out next:

  • win+r wt launches "<pathToPackageFolder>\wt.exe", process starts with command line="<pathToPackageFolder>\wt.exe" and it's getting ACCESS DENIED error when trying to read vcruntime140.dll and vcruntime140_1.dll which is placed inside that package folder.
  • explorer.exe shell:AppsFolder\Microsoft.WindowsTerminal_8wekyb3d8bbwe!App (and win+r cmd, and win+x shortcut) lauches "<pathToPackageFolder>\WindowsTerminal.exe", process starts with command line="<pathToPackageFolder>\WindowsTerminal.exe" and doing same queries as in previous case, but gets no error.
  • if i call wt from cmd (not from explorer or win+r) - it lauches "<pathToPackageFolder>\wt.exe" but without errors, and process starts with command line="wt"

These cases also has a bit diffirent ENVIRONMENT variables, and case with error have "<pathToPackageFolder>" in its PATH variable, i think it's cause error, but i dont see why this is happening on fresh clear installed activated windows 11 pro.

P.S. I'm new to asking questions and to this community, and english is not my first language, so i'll apretiate corrections and advices.

Pawel W
  • 15
Gidsik
  • 186

2 Answers2

0

As a workaround all this time i used custom hadrlink to ...AppData\Local\WindowsApps\wt.exe To create hardlink with powershell use this from elevated powershell:

New-Item -ItemType HardLink -Path "C:\Windows\mywt.exe" -Target "C:\Users\<username>\AppData\Local\WindowsApps\wt.exe"

After that i used mywt alias instead of wt and it works well.

Apparantly for me this bug somehow fixes in Windows Terminal v1.12.10393.0 release, now win+r wt launches "wt.exe" and process starts with command line="wt.exe", loads and works fine.

So if you strugling with this issue - try to reinstall with new version.

You can reinstall it via Windows Store, or manually, to reinstall manually you can follow next steps:

  • download .msixbundle file from here https://github.com/microsoft/terminal/tags
  • uninstall Windows Terminal from your PC (don't forget to backup your settings.json)
  • use Add-AppxPackage "full:/path/to/file.msixbundle" to install new version

EDIT:

My windows terminal brokes onces again, at this time the reason was somehow currupted ACLs on WindowsApps folder (which gives me access to folder and it's subfolders and caused wt to run with errors when launched by win+r, alias or from win+x menu)

symptomes was almost the same, but this time I fixed it by restoring default permissions on WindowsApps folder

here is a link to the solution I used https://superuser.com/a/1730061/1659735

Hope it will help you.

Gidsik
  • 186
0

Error

WT.exe Access is denied. WindowsTerminal.exe Access is denied.

#Solution Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.WindowsTerminal_8wekyb3d8bbwe