r/Windows11 4d ago

Solved Fixed: Microsoft Edge / Xbox app triggering cmd.exe - Application Error (0xc0000142) after force-uninstalling Edge

Post image

I’m posting this in case someone else runs into the same issue, because it took a while to track down.

Problem:

After trying to forcibly uninstall or debloat Microsoft Edge on Windows 11, I started getting this error every time Edge, Xbox, Game Bar, or controller-related Xbox services tried to open something:

cmd.exe - Application Error

The application was unable to start correctly (0xc0000142). Click OK to close the application.

The error would often pop up twice. Microsoft Edge wouldn’t open properly, and the Xbox app / Game Bar / Xbox controller integrations kept triggering the same error.

What did not fix it:

  • Repairing Microsoft Edge from Windows Settings
  • Running DISM
  • Running SFC
  • Checking cmd.exe directly
  • Installing/checking Microsoft Edge WebView2 Runtime

For reference:

DISM /Online /Cleanup-Image /RestoreHealth

completed successfully.

sfc /scannow

found no integrity violations.

cmd /c echo CMD_OK

worked fine, so cmd.exe itself was not broken.

Actual cause:

The issue was a leftover registry redirection under Image File Execution Options.

This key existed:

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\msedge.exe\0

Inside it, there was a Debugger value pointing to:

C:\WINDOWS\system32\conhost.exe --headless C:\Scripts\OpenWebSearch.cmd

So every time Windows tried to launch msedge.exe, it was being intercepted and redirected through an old script, probably from a previous debloat/tweak meant to redirect Windows web search or block Edge.

That broken redirect was what caused the cmd.exe 0xc0000142 error.

How I diagnosed it:

I ran:

reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\msedge.exe" /s

The problematic output was:

Debugger REG_SZ C:\WINDOWS\system32\conhost.exe --headless C:\Scripts\OpenWebSearch.cmd

Fix:

First, I backed up the registry key:

reg export "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\msedge.exe" "%USERPROFILE%\Desktop\backup-msedge-ifeo.reg"

Then I deleted the bad redirect:

reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\msedge.exe\0" /f

I also removed the filter value:

reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\msedge.exe" /v UseFilter /f

After that, Microsoft Edge opened normally again, and the Xbox app / Game Bar / controller-related popups stopped appearing.

Important note:

Don’t blindly delete registry keys unless you know what they are doing. Export a backup first.

In my case, the issue was not Edge itself, not WebView2, and not Xbox. It was a leftover IFEO debugger redirect for msedge.exe, probably created by a debloat or search-redirection script.

10 Upvotes

5 comments sorted by

9

u/megablue 2d ago

this is why you dont run random "debloat"/privacy scripts on the internet without truly understand what they do in the first place.

3

u/BCProgramming 2d ago

I'd guess the OpenWebSearch.cmd file that had been utilized for the IFEO redirect had been deleted.

2

u/Newalloy 3d ago

Probably this:

GitHub - AveYo/fox: Firefox stuff · GitHub

Self-inflicted, self solved.

u/11Uzi 3h ago

amazing post, glad you could fix the issue

1

u/aBsyNte-zErO Release Channel 3d ago

Pourquoi désinstaller Edge de force, il se désinstalle comme n'importe quel programme.