terminal icon indicating copy to clipboard operation
terminal copied to clipboard

Cannot start wt through "Run"

Open Anans2 opened this issue 1 year ago • 2 comments

Windows Terminal version

1.20.11781.0

Windows build number

10.0.26120.670

Other Software

No response

Steps to reproduce

win+R then type "wt" in Run

Expected Behavior

Start the terminal

Actual Behavior

wt crashed immediately, with the same logs just like https://github.com/microsoft/terminal/issues/13193.

AppName WindowsTerminal.exe AppVersion 1.21.2406.25002 AppTimeStamp 667b71e3 ModuleName ucrtbase.dll ModuleVersion 10.0.26100.751 ModuleTimeStamp cdc60ec5 ExceptionCode c0000409 FaultingOffset 00000000000a514e ProcessId 0x918 ProcessCreationTime 0x1dac9cdc051aa8e AppPath C:\Program Files\WindowsApps\Microsoft.WindowsTerminalPreview_1.21.1772.0_x64__8wekyb3d8bbwe\WindowsTerminal.exe ModulePath C:\WINDOWS\System32\ucrtbase.dll IntegratorReportId 53217967-c8f2-46a6-9b33-7883da184a4d PackageFullName
PackageRelativeAppId

However, with any other ways to start, like start menu, right-click menu or run "wt" in another terminal, it works well.

Anans2 avatar Jun 29 '24 03:06 Anans2

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

github-actions[bot] avatar Jun 29 '24 03:06 github-actions[bot]

Works perfectly fine for me on windows 11 home 23H2.

vinzmoke-zoro avatar Jun 30 '24 03:06 vinzmoke-zoro

I got the same issue on Windows 10 22H2 (Microsoft Windows NT 10.0.19045.0). Executing wt through "Run" fails immediately, an event viewer entry shows:

Faulting application name: WindowsTerminal.exe, version: 1.20.2405.17001, time stamp: 0x66479c60
Faulting module name: ucrtbase.dll, version: 10.0.19041.3636, time stamp: 0x81cf5d89
Exception code: 0xc0000409
Fault offset: 0x000000000007286e
Faulting process ID: 0x974
Faulting application start time: 0x01dacc28cccbb3c4
Faulting application path: C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.20.11381.0_x64__8wekyb3d8bbwe\WindowsTerminal.exe
Faulting module path: C:\WINDOWS\System32\ucrtbase.dll
Report ID: 894c8028-b6a7-4a1a-904d-2c89e0bb1e77
Faulting package full name: 
Faulting package-relative application ID: 

ThomasETN avatar Jul 02 '24 02:07 ThomasETN

While running "wt" fails, running by specifying the full path works, i.e. running %LOCALAPPDATA%\Microsoft\WindowsApps\wt.exe worked perfectly. This serves as my current workaround.

I doubled checked that %LOCALAPPDATA%\Microsoft\WindowsApps\wt.exe is already in my PATH

ThomasETN avatar Jul 02 '24 03:07 ThomasETN

Curious. What's the whole value of your PATH? Or more specifically, from CMD, what does where wt output/?

zadjii-msft avatar Jul 02 '24 11:07 zadjii-msft

WindowsTerminal_XRoEVcGnbv

C:\Users\<USERNAME>\AppData\Local\Microsoft\WindowsApps\wt.exe

ThomasETN avatar Jul 03 '24 03:07 ThomasETN

By the way, I found that running with explorer path box image will get the same crash, too🤔

Anans2 avatar Jul 05 '24 08:07 Anans2

For some reason, PowerToys run doesn't recognize wt at all on my machine.

AvogatoWizardWhisker avatar Jul 05 '24 09:07 AvogatoWizardWhisker

Can you try running this /? fsutil reparsepoint query %LOCALAPPDATA%\Microsoft\WindowsApps\wt.exe

We'd like to know the contents of that to debug this further.

carlos-zamora avatar Jul 10 '24 21:07 carlos-zamora

Running this command returns Error 3: The system cannot find the path specified.

image

I think it's because I have 4 wt.exe: Canary, Preview and Stable versions.

image

Although, I don't have an issue running wt from run dialog. (I just realized my last comment was off topic since I thought this is PowerToys repo. Oops) .

AvogatoWizardWhisker avatar Jul 10 '24 21:07 AvogatoWizardWhisker

Running this command returns Error 3: The system cannot find the path specified.

Thanks. We were more hoping for ThomasETN and Anans2 to help out with that. You seem to be having a different issue.

For you: can you turn off your app execution alias in the "Manage App Execution Aliases" settings page, and then turn it back on?

DHowett avatar Jul 10 '24 21:07 DHowett

Can you try running this /? fsutil reparsepoint query %LOCALAPPDATA%\Microsoft\WindowsApps\wt.exe

We'd like to know the contents of that to debug this further.

Reparse Tag Value : 0x8000001b
Tag value: Microsoft

Reparse Data Length: 0x16c
Reparse Data:
0000:  03 00 00 00 4d 00 69 00  63 00 72 00 6f 00 73 00  ....M.i.c.r.o.s.
0010:  6f 00 66 00 74 00 2e 00  57 00 69 00 6e 00 64 00  o.f.t...W.i.n.d.
0020:  6f 00 77 00 73 00 54 00  65 00 72 00 6d 00 69 00  o.w.s.T.e.r.m.i.
0030:  6e 00 61 00 6c 00 5f 00  38 00 77 00 65 00 6b 00  n.a.l._.8.w.e.k.
0040:  79 00 62 00 33 00 64 00  38 00 62 00 62 00 77 00  y.b.3.d.8.b.b.w.
0050:  65 00 00 00 4d 00 69 00  63 00 72 00 6f 00 73 00  e...M.i.c.r.o.s.
0060:  6f 00 66 00 74 00 2e 00  57 00 69 00 6e 00 64 00  o.f.t...W.i.n.d.
0070:  6f 00 77 00 73 00 54 00  65 00 72 00 6d 00 69 00  o.w.s.T.e.r.m.i.
0080:  6e 00 61 00 6c 00 5f 00  38 00 77 00 65 00 6b 00  n.a.l._.8.w.e.k.
0090:  79 00 62 00 33 00 64 00  38 00 62 00 62 00 77 00  y.b.3.d.8.b.b.w.
00a0:  65 00 21 00 41 00 70 00  70 00 00 00 43 00 3a 00  e.!.A.p.p...C.:.
00b0:  5c 00 50 00 72 00 6f 00  67 00 72 00 61 00 6d 00  \.P.r.o.g.r.a.m.
00c0:  20 00 46 00 69 00 6c 00  65 00 73 00 5c 00 57 00   .F.i.l.e.s.\.W.
00d0:  69 00 6e 00 64 00 6f 00  77 00 73 00 41 00 70 00  i.n.d.o.w.s.A.p.
00e0:  70 00 73 00 5c 00 4d 00  69 00 63 00 72 00 6f 00  p.s.\.M.i.c.r.o.
00f0:  73 00 6f 00 66 00 74 00  2e 00 57 00 69 00 6e 00  s.o.f.t...W.i.n.
0100:  64 00 6f 00 77 00 73 00  54 00 65 00 72 00 6d 00  d.o.w.s.T.e.r.m.
0110:  69 00 6e 00 61 00 6c 00  5f 00 31 00 2e 00 32 00  i.n.a.l._.1...2.
0120:  30 00 2e 00 31 00 31 00  33 00 38 00 31 00 2e 00  0...1.1.3.8.1...
0130:  30 00 5f 00 78 00 36 00  34 00 5f 00 5f 00 38 00  0._.x.6.4._._.8.
0140:  77 00 65 00 6b 00 79 00  62 00 33 00 64 00 38 00  w.e.k.y.b.3.d.8.
0150:  62 00 62 00 77 00 65 00  5c 00 77 00 74 00 2e 00  b.b.w.e.\.w.t...
0160:  65 00 78 00 65 00 00 00  30 00 00 00              e.x.e...0...

(CyberChef) Microsoft.WindowsTerminal_8wekyb3d8bbweMicrosoft.WindowsTerminal_8wekyb3d8bbwe!AppC:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.20.11381.0_x64__8wekyb3d8bbwe\wt.exe

ThomasETN avatar Jul 11 '24 03:07 ThomasETN

Can you try running this /? fsutil reparsepoint query %LOCALAPPDATA%\Microsoft\WindowsApps\wt.exe

We'd like to know the contents of that to debug this further.

image

just like AvogatoWizardWhisker's. Is it right? I can start wt through this path🤔

Anans2 avatar Jul 16 '24 09:07 Anans2

I think you should run fsutil reparsepoint query %LOCALAPPDATA%\Microsoft\WindowsApps\wt.exe on CMD instead of PowersShell

ThomasETN avatar Jul 16 '24 09:07 ThomasETN

I think you should run fsutil reparsepoint query %LOCALAPPDATA%\Microsoft\WindowsApps\wt.exe on CMD instead of PowersShell

Ok, then I get the same output.

Anans2 avatar Jul 16 '24 15:07 Anans2

Hmm... Ok, could you use feedback hub to get a trace for us /? Thanks

Can you also go into your Windows settings and switch the app execution alias? You mentioned 1.20 in the bug report, but the log you posted says 1.21, so we're a bit suspicious of that.

/feedback

carlos-zamora avatar Jul 17 '24 21:07 carlos-zamora

other notes:

  • you mentioned a Stable terminal version at the top of the post, but then the crash is coming from a Preview build of the Terminal.
  • WindowsTerminal.exe is the thing that's crashing (not wt.exe). So running wt did spawn and get into WindowsTerminal
  • your wt.exe does point at the stable one
  • is the stable one handing off to the preview terminal somehow? that'd be weird

zadjii-msft avatar Jul 17 '24 21:07 zadjii-msft

I doubt if it has anything to do with the preview versions, because unlike Anans2 I'm on 1.20.11381.0 all along, I don't even have the preview version installed... yet we seem to be facing the same issue 🤔

ThomasETN avatar Jul 18 '24 02:07 ThomasETN

https://aka.ms/AArhdba

ThomasETN avatar Jul 18 '24 02:07 ThomasETN

other notes:

  • you mentioned a Stable terminal version at the top of the post, but then the crash is coming from a Preview build of the Terminal.
  • WindowsTerminal.exe is the thing that's crashing (not wt.exe). So running wt did spawn and get into WindowsTerminal
  • your wt.exe does point at the stable one
  • is the stable one handing off to the preview terminal somehow? that'd be weird

Oh, I got it wrong. I have tried switching to the preview version to repair it but got the same result. Now I am certainly using the stable one.

AppName WindowsTerminal.exe AppVersion 1.20.2406.26001 AppTimeStamp 667c7d41 ModuleName ucrtbase.dll ModuleVersion 10.0.26100.973 ModuleTimeStamp bc5981b4 ExceptionCode c0000409 FaultingOffset 00000000000a514e ProcessId 0x3b5c ProcessCreationTime 0x1dad9cd7d4cfb7e AppPath C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.20.11781.0_x64__8wekyb3d8bbwe\WindowsTerminal.exe ModulePath C:\WINDOWS\System32\ucrtbase.dll IntegratorReportId 53acd177-c47a-4cd0-97f6-e62d8cb6af31 PackageFullName
PackageRelativeAppId

I found that starting through the path "C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.20.11781.0_x64__8wekyb3d8bbwe\wt.exe" will make it crash. However, using the softlink "%LOCALAPPDATA%\Microsoft\WindowsApps\wt.exe" works will, even though the softlink points to former one🤔 I guess that the Run used the former one and shell used the latter.

Anans2 avatar Jul 19 '24 11:07 Anans2

Huh well yep that would do it! Can you run the following in an admin command prompt window:

cacls "C:\Program Files\WindowsApps" /S

we think the permissions on WindowsApps did get messed up, which is why this is failing to spawn. If the permissions did get messed up, there's not a ton we can do. If it was only the Terminal package that had bad permission, it'd be possible that a reinstall might fix it. But if it's all of WindowsApps, you're in for a bad time.

zadjii-msft avatar Jul 24 '24 20:07 zadjii-msft

As requested in #17593 above

cacls "C:\Program Files\WindowsApps" /S
C:\Program Files\WindowsApps "D:PAI(A;OICI;0x1200a9;;;RC)(A;;FA;;;SY)(A;OICIIO;GA;;;SY)(A;OICI;0x1200a9;;;LS)(A;OICI;0x1200a9;;;NS)(A;CI;0x1200a9;;;BA)(A;OICI;FA;;;BA)(A;OICIIO;0x1200a9;;;BU)(XA;;0x1200a9;;;BU;(Exists WIN://SYSAPPID))(A;OICIIO;GA;;;S-1-5-80-956008885-3418522649-1831038044-1853292631-2271478464)(A;;FA;;;S-1-5-80-956008885-3418522649-1831038044-1853292631-2271478464)(A;OICI;0x1200a9;;;AC)(A;;0x1200a9;;;S-1-15-3-1024-3635283841-2530182609-996808640-1887759898-3848208603-3313616867-983405619-2501854204)(A;OICIIO;GXGR;;;S-1-15-3-1024-3635283841-2530182609-996808640-1887759898-3848208603-3313616867-983405619-2501854204)"

Pretty-printed output

cacls "C:\Program Files\WindowsApps" /S
C:\Program Files\WindowsApps
"
	D:PAI(A;OICI;0x1200a9;;;RC)
	(A;;FA;;;SY)
	(A;OICIIO;GA;;;SY)
	(A;OICI;0x1200a9;;;LS)
	(A;OICI;0x1200a9;;;NS)
	(A;CI;0x1200a9;;;BA)
	(A;OICI;FA;;;BA)
	(A;OICIIO;0x1200a9;;;BU)
	(XA;;0x1200a9;;;BU;(Exists WIN://SYSAPPID))
	(A;OICIIO;GA;;;S-1-5-80-956008885-3418522649-1831038044-1853292631-2271478464)
	(A;;FA;;;S-1-5-80-956008885-3418522649-1831038044-1853292631-2271478464)
	(A;OICI;0x1200a9;;;AC)
	(A;;0x1200a9;;;S-1-15-3-1024-3635283841-2530182609-996808640-1887759898-3848208603-3313616867-983405619-2501854204)
	(A;OICIIO;GXGR;;;S-1-15-3-1024-3635283841-2530182609-996808640-1887759898-3848208603-3313616867-983405619-2501854204)
"

It's worth noting that I had this same issue on a relatively fresh install of a Windows 11 laptop (a SEPARATE computer that I have not mentioned in the bug report above). I checked and lo-and-behold %programfiles%\WindowsApps was visible to me, so I must have attempted to open it before. I used this SE/SU answer to restore permissions to the WindowsApps folder itself and return ownership to NT Service / TrustedInstaller. After running the cacls command and using the GUI to change the owner, wt worked again.

I tried using a combination of this and the WindowsAppsUn## tool made by AgentRev on the computer mentioned in my bug report, and this did not work, which makes sense as this is a very old W10 install and I've likely messed with the WindowsApps folder a few times over its life. It might even have been carried forward all the way from Windows 7, 8, 8.1 ... but specifically, I blame the icacls /reset command that is suggested in numerous places on the internet. This command apparently CLOBBERS the permissions recursively inside the WindowsApps folder and I'm annoyed that its use is so widespread.

DO NOT RUN THIS COMMAND ⚠⚠⚠⚠
ic​acls "C:\Program Files\WindowsApps" /res​et /t /c /q
       DO NOT RUN                     ^^^^^^^^^

kenblu24 avatar Jul 24 '24 22:07 kenblu24

C:\Program Files\WindowsApps "D:AI(A;ID;FA;;;S-1-5-80-956008885-3418522649-1831038044-1853292631-2271478464)(A;CIIOID;GA;;;S-1-5-80-956008885-3418522649-1831038044-1853292631-2271478464)(A;ID;FA;;;SY)(A;OICIIOID;GA;;;SY)(A;ID;FA;;;BA)(A;OICIIOID;GA;;;BA)(A;ID;0x1200a9;;;BU)(A;OICIIOID;GXGR;;;BU)(A;ID;FA;;;S-1-5-21-2887018048-3378311400-3291514223-1003)(A;OICIIOID;GA;;;CO)(A;ID;0x1200a9;;;AC)(A;OICIIOID;GXGR;;;AC)(A;ID;0x1200a9;;;S-1-15-2-2)(A;OICIIOID;GXGR;;;S-1-15-2-2)"

ThomasETN avatar Jul 25 '24 01:07 ThomasETN

C:\Program Files\WindowsApps "D:PAI(A;OICI;FA;;;S-1-5-80-956008885-3418522649-1831038044-1853292631-2271478464)(A;OICI;0x1200a9;;;S-1-15-3-1024-3635283841-2530182609-996808640-1887759898-3848208603-3313616867-983405619-2501854204)(A;OICI;FA;;;SY)(A;CI;0x1200a9;;;BA)(A;OICI;0x1200a9;;;LS)(A;OICI;0x1200a9;;;NS)(A;OICI;0x1200a9;;;RC)(XA;;0x1200a9;;;BU;(Exists WIN://SYSAPPID))(A;OICI;FA;;;S-1-5-21-1748280977-1158525368-2915346297-1001)"

Anans2 avatar Jul 25 '24 04:07 Anans2

As requested in #17593 & above

cacls "C:\Program Files\WindowsApps" /S
C:\Program Files\WindowsApps "D:PAI(A;;FA;;;S-1-5-80-956008885-3418522649-1831038044-1853292631-2271478464)(A;OICIIO;FA;;;S-1-5-80-956008885-3418522649-1831038044-1853292631-2271478464)(A;;0x1200a9;;;S-1-15-3-1024-3635283841-2530182609-996808640-1887759898-3848208603-3313616867-983405619-2501854204)(A;OICIIO;0x1200a9;;;S-1-15-3-1024-3635283841-2530182609-996808640-1887759898-3848208603-3313616867-983405619-2501854204)(A;;FA;;;SY)(A;OICIIO;FA;;;SY)(A;CI;0x1200a9;;;BA)(A;OICI;0x1200a9;;;LS)(A;OICI;0x1200a9;;;NS)(A;OICI;0x1200a9;;;RC)(XA;;0x1200a9;;;BU;(Exists WIN://SYSAPPID))(A;OICI;FA;;;S-1-5-21-280656841-2507282897-2809039123-1003)"

Prettified:

cacls "C:\Program Files\WindowsApps" /S
C:\Program Files\WindowsApps
"
    D:PAI
    (A;      ;FA      ;;;S-1-5-80-956008885-3418522649-1831038044-1853292631-2271478464)
    (A;OICIIO;FA      ;;;S-1-5-80-956008885-3418522649-1831038044-1853292631-2271478464
        (A ;      ;0x1200a9;;;S-1-15-3-1024-3635283841-2530182609-996808640-1887759898-3848208603-3313616867-983405619-2501854204)
        (A ;OICIIO;0x1200a9;;;S-1-15-3-1024-3635283841-2530182609-996808640-1887759898-3848208603-3313616867-983405619-2501854204)
        (A ;      ;FA      ;;;SY)
        (A ;OICIIO;FA      ;;;SY)
        (A ;CI    ;0x1200a9;;;BA)
        (A ;OICI  ;0x1200a9;;;LS)
        (A ;OICI  ;0x1200a9;;;NS)
        (A ;OICI  ;0x1200a9;;;RC)
        (XA;      ;0x1200a9;;;BU;
            (Exists WIN://SYSAPPID)
        )
    (A;OICI  ;FA      ;;;S-1-5-21-280656841-2507282897-2809039123-1003)
"

Eagle3386 avatar Jul 26 '24 15:07 Eagle3386

Facing the same issue as #17593 from last two days.

cacls command output:

cacls "C:\Program Files\WindowsApps" /S
C:\Program Files\WindowsApps "D:PAI(A;OICI;0x1200a9;;;RC)(A;;FA;;;SY)(A;OICIIO;GA;;;SY)(A;OICI;0x1200a9;;;LS)(A;OICI;0x1200a9;;;NS)(A;CI;0x1200a9;;;BA)(A;OICI;FA;;;BA)(A;OICIIO;0x1200a9;;;BU)(XA;;0x1200a9;;;BU;(Exists WIN://SYSAPPID))(A;OICIIO;GA;;;S-1-5-80-956008885-3418522649-1831038044-1853292631-2271478464)(A;;FA;;;S-1-5-80-956008885-3418522649-1831038044-1853292631-2271478464)(A;OICI;0x1200a9;;;AC)(A;;0x1200a9;;;S-1-15-3-1024-3635283841-2530182609-996808640-1887759898-3848208603-3313616867-983405619-2501854204)(A;OICIIO;GXGR;;;S-1-15-3-1024-3635283841-2530182609-996808640-1887759898-3848208603-3313616867-983405619-2501854204)"

Formatted:

cacls "C:\Program Files\WindowsApps" /S
C:\Program Files\WindowsApps 
"
D:PAI
(A;OICI;0x1200a9;;;RC)
(A;;FA;;;SY)
(A;OICIIO;GA;;;SY)
(A;OICI;0x1200a9;;;LS)
(A;OICI;0x1200a9;;;NS)
(A;CI;0x1200a9;;;BA)
(A;OICI;FA;;;BA)
(A;OICIIO;0x1200a9;;;BU)
(XA;;0x1200a9;;;BU;(Exists WIN://SYSAPPID))
(A;OICIIO;GA;;;S-1-5-80-956008885-3418522649-1831038044-1853292631-2271478464)
(A;;FA;;;S-1-5-80-956008885-3418522649-1831038044-1853292631-2271478464)
(A;OICI;0x1200a9;;;AC)
(A;;0x1200a9;;;S-1-15-3-1024-3635283841-2530182609-996808640-1887759898-3848208603-3313616867-983405619-2501854204)
(A;OICIIO;GXGR;;;S-1-15-3-1024-3635283841-2530182609-996808640-1887759898-3848208603-3313616867-983405619-2501854204)
"

When execute WT alias from CMD or Terminal it runs without crashing but when executed from Start menu, Run (Win + R) and File Explorer address bar, it crashes silently and I get following error in Event Viewer.

Event Viewer entry:

Faulting application name: WindowsTerminal.exe, version: 1.20.2406.26001, time stamp: 0x667c7d41
Faulting module name: ucrtbase.dll, version: 10.0.22621.3593, time stamp: 0x10c46e71
Exception code: 0xc0000409
Fault offset: 0x000000000007f6fe
Faulting process id: 0x0x2C48
Faulting application start time: 0x0x1DAE05F8E4F8511
Faulting application path: C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.20.11781.0_x64__8wekyb3d8bbwe\WindowsTerminal.exe
Faulting module path: C:\WINDOWS\System32\ucrtbase.dll
Report Id: 6fd320cb-3ae4-45da-bf07-f38093d5c418
Faulting package full name: 
Faulting package-relative application ID: 

Tried repair-reset-reinstall many times but not working.

AryanJoshii avatar Jul 27 '24 20:07 AryanJoshii

I used this SE/SU answer to restore permissions to the WindowsApps folder itself and return ownership to NT Service / TrustedInstaller. After running the cacls command and using the GUI to change the owner, wt worked again.

Thank you. I can run wt again after following https://superuser.com/questions/1288014/reset-default-acls-for-c-program-files-windowsapps/1730061#1730061. Will try to use https://github.com/AgentRev/WindowsAppsUnfukker in the future.

eight04 avatar Oct 20 '24 18:10 eight04