@echo off
:: ============================================================
:: SetDisableBackgroundApps.bat
::
:: Disable Background Apps Globally.
:: Prevents Store apps from running in the background to save resources and battery.
:: ============================================================

reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications" /v "GlobalUserDisabled" /t REG_DWORD /d "1" /f

if %ERRORLEVEL% EQU 0 (
    echo Disable Background Apps Globally applied.
) else (
    echo Failed to apply tweak. Try running this script as Administrator.
)
pause