Skip to content

Instantly share code, notes, and snippets.

@Mysli0210
Created December 3, 2025 21:31
Show Gist options
  • Select an option

  • Save Mysli0210/2d838e3e14aff3c84f02b7f6a8e90e3d to your computer and use it in GitHub Desktop.

Select an option

Save Mysli0210/2d838e3e14aff3c84f02b7f6a8e90e3d to your computer and use it in GitHub Desktop.
Batch script for disabling gamebar, more specifically prevent a dialogue from popping up when plugging in a gamepad/controller (after debloating)
@echo off
reg add HKCR\ms-gamebar /f /ve /d "URL:ms-gamebar"
reg add HKCR\ms-gamebar /f /v "URL Protocol" /d ""
reg add HKCR\ms-gamebar /f /v "NoOpenWith" /d ""
reg add HKCR\ms-gamebar\shell\open\command /f /ve /d "%SystemRoot%\System32\cmd.exe /c exit"
reg add HKCR\ms-gamebarservices /f /ve /d "URL:ms-gamebarservices"
reg add HKCR\ms-gamebarservices /f /v "URL Protocol" /d ""
reg add HKCR\ms-gamebarservices /f /v "NoOpenWith" /d ""
reg add HKCR\ms-gamebarservices\shell\open\command /f /ve /d "%SystemRoot%\System32\cmd.exe /c exit"
reg add HKCR\ms-gamingoverlay /f /ve /d "URL:ms-gamingoverlay"
reg add HKCR\ms-gamingoverlay /f /v "URL Protocol" /d ""
reg add HKCR\ms-gamingoverlay /f /v "NoOpenWith" /d ""
reg add HKCR\ms-gamingoverlay\shell\open\command /f /ve /d "%SystemRoot%\System32\cmd.exe /c exit"
gpupdate /force
echo Done. Restart to apply.
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment