terminal: 0xc0000022 startup error when opening wt from file explorer or Run window

Environment

Windows build number: Microsoft Windows [Version 10.0.18363.959]
Windows Terminal version (if applicable): 1.1.2021.0

Any other software?

Found this in my PATH:

%USERPROFILE%\AppData\Local\Microsoft\WindowsApps

Alias settings: image

I tried turning my computer off and on again 😉 This error started popping up very recently, maybe I could try to install an old version to try to find the one that triggers this. I install from Windows Store, and don’t really know how to do that. I think this shows the time of last update: image I think the time when the bug started to appear might coincide.

Steps to reproduce

Type wt in the file explorer, or Run window.

It works if I search for wt and open it. Also works if I navigate to C:\Users\<USERNAME>\AppData\Local\Microsoft\WindowsApps and run it manually. Doesn’t work though from both the Run window and file explorer.

I also tried typing wt in the Run window, then pressing Ctrl+Shift+Enter, a popup appeared to ask for permission, but the same error appeared after allowing.

Expected behavior

It opens.

Actual behavior

I get 0xc0000022 error image

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 3
  • Comments: 50 (6 by maintainers)

Most upvoted comments

A solution I found- changing the values in the following registries: Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\wt.exe from the C:\Program Files\WindowsApps\ path, to the path in C:\Users\USERNAME\AppData\Local\Microsoft\WindowsApps\

I was able to fix the issue by resetting permissions to the WindowsApps folder. wt works as expected after running the command below in an elevated PowerShell:

icacls "C:\Program Files\WindowsApps" /reset /t /c /q

A solution I found- changing the values in the following registries: Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\wt.exe from the C:\Program Files\WindowsApps\ path, to the path in C:\Users\USERNAME\AppData\Local\Microsoft\WindowsApps\

This method works for me. I found that "C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.11.3471.0_x64__8wekyb3d8bbwe\wt.exe" is a uwp, and can not directly run. You should run %LOCALAPPDATA%\Microsoft\WindowsApps\wt.exe (It’s a zero sized file, maybe called app execution alias) instead.

image image

But I find other items in Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\App Paths are using path like C:\Program Files\WindowsApps\MicrosoftCorporationII.WindowsSubsystemforLinux_0.51.3.0_x64__8wekyb3d8bbwe.

icacls not working, but I found a workaround:

  • Uninstall Windows Terminal.
  • Goto Settings → System → Storage → Change where new content is saved and change “New apps will save to” from C: to D:.
  • Install Windows Terminal.

Then I can run wt from Run window.

The method I followed was the one laid out here.

@KyleCrowley oh yeah that makes sense to me now. because reinstalling windows is like using SYSTEM to do stuff. psexec.exe -s -i cmd

I thought this issue was my SSD breaking up files since it has signs of making files incorrectly usable (a jar file broken).

So I went through a DISM, SFC, DSKCHK but they aren’t working at all.

Plus upgrading to 20H2 doesn’t seem to fix it since upgrading windows will reinstall drivers, Windows apps.

Edit:

My problem is that I’m afraid I messed up the permissions of WindowsApps and Microsoft.WindowsTerminal_versionNumber_arch__probablyGUIDOrSomething without notices and I don’t want to mess up the permissions of WindowsApps anymore so I got a fix for this:

Use powershell under Administrator and run Remove-AppxPackage [Whatever is the full name of the Windows Terminal package name is for example: Microsoft.WindowsTerminal_1.3.2651.0_x64__8wekyb3d8bbwe].

This will ACTUALLY DELETE the program’s folder and not keeping the app files when uninstalling them in Settings app.

Go back to Microsoft Store and reinstall it and you’re done.

Suddenly got this issue as well, without touching my installation after updating through the Store

However, @dexeonify’s steps have helped. To be exact, taking ownership of the Windows Terminal folder in C:\Program Files\WindowsApps fixed the problem

Please consider reopening this issue

I am getting this issue starting this morning. Windows updated something (I think security related) and when I booted up I get the same error. Unfortunately for me, drive formatting isn’t really an option as it’s just not worth it.

Currently I’m just switching back to powershell, but it would be nice if there was a fix/solution for this

Thanks for following up! I’m gonna close this out as not reproducing, but please do let me know if it comes back.