Disable Game Mode.bat

This commit is contained in:
Michael Meadow 2024-01-22 00:59:54 -08:00 committed by GitHub
parent fc53fb179b
commit 3b81a8d679
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

38
Disable Game Mode.bat Normal file
View File

@ -0,0 +1,38 @@
@echo off
SETLOCAL EnableExtensions EnableDelayedExpansion
echo Reverting changes and setting default shell back to Explorer
:: Reset the default shell to Explorer
SET "EXPLORER_PATH=C:\Windows\explorer.exe"
REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Shell /t REG_SZ /d "%EXPLORER_PATH%" /f
:: Define the default Steam folder path
SET "STEAM_FOLDER=C:\Program Files (x86)\Steam"
:: Delete the DelayedExplorerStart.bat script and related files
SET "SCRIPT_NAME=DelayedExplorerStart.bat"
SET "SCRIPT_PATH=%STEAM_FOLDER%\%SCRIPT_NAME%"
IF EXIST "%SCRIPT_PATH%" DEL "%SCRIPT_PATH%"
SET "VBS_NAME=RunBatchSilently.vbs"
SET "VBS_PATH=%STEAM_FOLDER%\%VBS_NAME%"
IF EXIST "%VBS_PATH%" DEL "%VBS_PATH%"
SET "XML_NAME=DelayedExplorerStartTask.xml"
SET "XML_PATH=%STEAM_FOLDER%\%XML_NAME%"
IF EXIST "%XML_PATH%" DEL "%XML_PATH%"
:: Delete the scheduled task
schtasks /delete /tn "RunDelayedExplorerStart" /f
:: Disable automatic logon
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v AutoAdminLogon /t REG_SZ /d 0 /f
reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultPassword /f
:: Enable the boot UI
bcdedit.exe -set {globalsettings} bootuxdisabled off
echo Reversion complete. Default settings restored.
pause