Fixes the "We can't open this 'ms-gamebar' link" / "Pick an app" popup that appears every time an Xinput controller is connected on Windows installs that don't have the Xbox Game Bar app.
- Redirects the
ms-gamebarandms-gamebarservicesprotocol handlers to a harmless no-op (systray.exe) instead of a missing app, so Windows "opens" the link silently instead of throwing an error. - Disables the activation of
GameBarPresenceWriter.exe, which otherwise re-registers those same protocols back to the missing app every time a controller reconnects, undoing step 1.
Step 2 requires taking ownership of a registry key protected by
TrustedInstaller. Doing that requires enabling SeTakeOwnershipPrivilege
first — being an administrator alone is not enough, Windows disables that
privilege by default even in an elevated process.
fix_xinput_gamebar_popup.bat— run this one. Self-elevates via UAC.take_ownership_presencewriter.ps1— plain-text version of the PowerShell code that's embedded as base64 inside the.bat(via-EncodedCommand). Included so you can read exactly what runs before trusting the.bat.
The .bat self-elevates via UAC and runs a base64-encoded PowerShell block.
That combination (base64 + auto-elevation) is a common pattern in malicious
scripts too, so Windows Defender or SmartScreen may flag it. Read
take_ownership_presencewriter.ps1 first if you want to verify it's exactly
what's encoded in the .bat before running it.
Double-click fix_xinput_gamebar_popup.bat, accept the UAC prompt. No
further input needed. A reboot (or at least log off/on) is recommended
afterward so the COM activation cache clears.