Getting error due to Xbox Game Bar not running - Need help coding work around or configuring GPOs

We have our bot machines running on VM builds of Windows 10. They are primarily unattended machines running foreground processes under service account Windows network AD accounts.

When the automation kicks off, occasionally it will be blocked with the following error:

Cannot bring the target application in the foreground. The action was blocked by the current foreground window ‘This app can’t open’ from the process ‘explorer.exe.’

We have multiple automations so writing code in each one to handle this is going to be a bit of a workload. Does anyone have any experience with this particular error due to the XBox Game Bar and knows of a GPO, registry key, etc., that will prevent the indicated foreground window from coming up on login?

Try these approaches:

Note: You will need the Administrator privileges and a system restart after the change.

Disable by using Group Policy.

  1. Press the Windows logo button and R button simultaneously to open Run dialog.
  2. Type gpedit.msc into the text box.
  3. Click on the OK button to open Local Group Policy Editor.
  4. Expand Computer Configuration, Administrative Templates, Windows Components, and Windows Game Recording and Broadcasting in order.
  5. Right-click Enables or disables Windows Game Recording and Broadcasting from the right panel.
  6. Check Disabled and click on the OK button to confirm.

There is a registry key that can be used to disable the Game Bar, but it is not recommended to modify the registry unless you are comfortable doing so. If you are not comfortable modifying the registry, you can try using a third-party tool to disable the Game Bar.
To disable the Game Bar using the registry, follow these steps:

  1. Open the Registry Editor (regedit.exe).
  2. Navigate to the following key:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\GameDVR

  1. Create a new DWORD value called AppCaptureEnabled and set its value to 0.
  2. Close the Registry Editor.
    To disable the Game Bar using a third-party tool, you can use a tool such as Game Mode Disabler or Disable Game Bar.
    Note: Disabling the Game Bar may also prevent you from using other features that rely on the Game Bar, such as the Xbox Game Bar overlay and the Windows Recorder.

In poweshell.exe as Administrator:

you can also try using this powershell command:

Get-AppxPackage Microsoft.XboxGamingOverlay | Remove-AppxPackage

As the name of the “Game Bar” is XboxGamingOverlay.



For more details check here: https://www.thewindowsclub.com/enable-disable-game-dvr-windows-10


Check if in your UiPath Automations (especially the ones which use Send Hotkey) are not using the same Windows commands to open Xbox Game bar.

If the Xbox Game Bar is disabled completely, those windows commands from your Ui Automations will not impact you.