' ============================================================
' SetDisableGameBar.vbs
'
' Disable Xbox Game Bar Capture.
' Disables background game/app capture via the Xbox Game Bar.
'
' Usage: cscript SetDisableGameBar.vbs
' ============================================================

Option Explicit

Dim objShell
Set objShell = CreateObject("WScript.Shell")

On Error Resume Next
objShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\GameDVR\AppCaptureEnabled", 0, "REG_DWORD"

If Err.Number = 0 Then
    WScript.Echo "Disable Xbox Game Bar Capture applied."
Else
    WScript.Echo "Failed to apply tweak (Error " & Err.Number & ": " & Err.Description & ")"
End If
On Error Goto 0