⚡ PowerShell 5.1+

Disable Xbox Game Bar Capture

Disables background game/app capture via the Xbox Game Bar.

By WindowsScripting.com · 696 B
Set-DisableGameBar.ps1
<#
.SYNOPSIS
    Disable Xbox Game Bar Capture.

.DESCRIPTION
    Disables background game/app capture via the Xbox Game Bar.

    Sets HKCU:\Software\Microsoft\Windows\CurrentVersion\GameDVR \ AppCaptureEnabled to 0.

.EXAMPLE
    .\Set-DisableGameBar.ps1
#>

[CmdletBinding()]
param()

$regPath = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\GameDVR'

if (-not (Test-Path $regPath)) {
    New-Item -Path $regPath -Force | Out-Null
}

New-ItemProperty -Path $regPath -Name 'AppCaptureEnabled' -Value 0 -PropertyType DWord -Force | Out-Null

Write-Host "Disable Xbox Game Bar Capture applied. Sign out and back in (or restart explorer.exe) for it to fully take effect." -ForegroundColor Green