Attribute VB_Name = "DisableGameBarRegCheck"
Option Explicit

Public Sub DisableGameBarRegCheck()
    Dim wsh As Object
    Dim regPath As String
    Dim value As Variant

    Set wsh = CreateObject("WScript.Shell")
    regPath = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\GameDVR\AppCaptureEnabled"

    On Error Resume Next
    value = wsh.RegRead(regPath)
    On Error GoTo 0

    If IsEmpty(value) Then
        MsgBox "Value not set:" & vbCrLf & regPath, vbExclamation, "Disable Xbox Game Bar Capture"
    Else
        MsgBox "Disable Xbox Game Bar Capture" & vbCrLf & regPath & " = " & value, vbInformation
    End If
End Sub