Update Enable GamesDows v2.bat

This commit is contained in:
jazir5 2024-09-02 13:24:36 -07:00 committed by GitHub
parent 5f0e56eb72
commit de90b6b003
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -56,50 +56,31 @@ if %errorlevel% neq 0 (
echo Creating DelayedExplorerStart.bat script echo Creating DelayedExplorerStart.bat script
:: Create the DelayedExplorerStart.bat script in the Steam folder echo Create the DelayedExplorerStart.bat script in the Steam folder
( (
echo @echo off echo @echo off
echo :CHECK_LOGON echo Check if user is logged on
echo query user ^| find /i "%USERNAME%" ^>nul echo query user ^| find /i "%USERNAME%" ^>nul
echo if %errorlevel% neq 0 ^( echo if ERRORLEVEL 1 exit
echo timeout /t 10 /nobreak ^>nul echo Set Shell back to Explorer
echo goto CHECK_LOGON echo REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Shell /t REG_SZ /d "%EXPLORER_PATH%" /f
echo ^)
echo echo Set Shell back to Explorer
echo REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Shell /t REG_SZ /d "!EXPLORER_PATH!" /f
echo if %%errorlevel%% neq 0 ^(
echo echo Error setting shell to Explorer
echo exit /b 1
echo ^)
echo timeout /t 20 /nobreak ^>nul echo timeout /t 20 /nobreak ^>nul
echo start C:\Windows\explorer.exe echo start C:\Windows\explorer.exe
echo timeout /t 10 /nobreak ^>nul echo timeout /t 10 /nobreak ^>nul
echo REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Shell /t REG_SZ /d "\"!ADMIN_VBS_PATH!\"" /f echo REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Shell /t REG_SZ /d "%STEAM_PATH%" /f
echo if %%errorlevel%% neq 0 ^( ) > "%SCRIPT_PATH%"
echo echo Error setting shell to Steam
echo exit /b 1
echo ^)
) > "!SCRIPT_PATH!"
if %errorlevel% neq 0 (
echo Error creating DelayedExplorerStart.bat
pause
exit /b 1
)
echo Create XML file for the scheduled task echo Create XML file for the scheduled task
SET "XML_PATH=%STEAM_FOLDER%\DelayedExplorerStartTask.xml" SET XML_PATH=%STEAM_FOLDER%\DelayedExplorerStartTask.xml
echo Delete the existing XML file if it exists echo Delete the existing XML file if it exists
IF EXIST "!XML_PATH!" DEL "!XML_PATH!" IF EXIST "%XML_PATH%" DEL "%XML_PATH%"
for /f "tokens=2 delims==" %%I in ('wmic os get localdatetime /value') do set datetime=%%I
set CURRENT_DATE=%datetime:~0,4%-%datetime:~4,2%-%datetime:~6,2%T%datetime:~8,2%:%datetime:~10,2%:%datetime:~12,2%
( (
echo ^<?xml version="1.0" encoding="UTF-16"?^> echo ^<?xml version="1.0" encoding="UTF-16"?^>
echo ^<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task"^> echo ^<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task"^>
echo ^<RegistrationInfo^> echo ^<RegistrationInfo^>
echo ^<Date^>!CURRENT_DATE!^</Date^> echo ^<Date^>2020-01-01T00:00:00^</Date^>
echo ^<Author^>"%USERNAME%"^</Author^> echo ^<Author^>"%USERNAME%"^</Author^>
echo ^<Description^>Run DelayedExplorerStart.bat at logon.^</Description^> echo ^<Description^>Run DelayedExplorerStart.bat at logon.^</Description^>
echo ^</RegistrationInfo^> echo ^</RegistrationInfo^>
@ -110,7 +91,7 @@ set CURRENT_DATE=%datetime:~0,4%-%datetime:~4,2%-%datetime:~6,2%T%datetime:~8,2%
echo ^</Triggers^> echo ^</Triggers^>
echo ^<Principals^> echo ^<Principals^>
echo ^<Principal id="Author"^> echo ^<Principal id="Author"^>
echo ^<UserId^>%USERNAME%^</UserId^> echo ^<UserId^>%USERNAME%</UserId^>
echo ^<LogonType^>InteractiveToken^</LogonType^> echo ^<LogonType^>InteractiveToken^</LogonType^>
echo ^<RunLevel^>HighestAvailable^</RunLevel^> echo ^<RunLevel^>HighestAvailable^</RunLevel^>
echo ^</Principal^> echo ^</Principal^>
@ -135,16 +116,11 @@ set CURRENT_DATE=%datetime:~0,4%-%datetime:~4,2%-%datetime:~6,2%T%datetime:~8,2%
echo ^<Actions Context="Author"^> echo ^<Actions Context="Author"^>
echo ^<Exec^> echo ^<Exec^>
echo ^<Command^>wscript.exe^</Command^> echo ^<Command^>wscript.exe^</Command^>
echo ^<Arguments^>"!VBS_PATH!"^</Arguments^> echo ^<Arguments^>"%VBS_PATH%"^</Arguments^>
echo ^</Exec^> echo ^</Exec^>
echo ^</Actions^> echo ^</Actions^>
echo ^</Task^> echo ^</Task^>
) > "!XML_PATH!" ) > "%XML_PATH%"
if %errorlevel% neq 0 (
echo Error creating XML file
pause
exit /b 1
)
echo Delete the existing scheduled task if it exists echo Delete the existing scheduled task if it exists
schtasks /delete /tn "RunDelayedExplorerStart" /f schtasks /delete /tn "RunDelayedExplorerStart" /f
@ -157,5 +133,39 @@ if %errorlevel% neq 0 (
exit /b 1 exit /b 1
) )
echo Delayed Explorer start script and VBScript created in Steam folder.
echo Scheduled Task added to run the script at logon.
echo XML file for Scheduled Task created.
echo Disable the boot UI
bcdedit.exe -set {globalsettings} bootuxdisabled on
echo Disable Visual Effects
reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v VisualEffects /t REG_DWORD /d 3 /f
echo Increase File System Performance
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem" /v NtfsDisableLastAccessUpdate /t REG_DWORD /d 1 /f
echo Optimize Paging File Performance
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v DisablePagingExecutive /t REG_DWORD /d 1 /f
echo Disable Startup Delay
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Serialize" /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Serialize" /v StartupDelayInMSec /t REG_DWORD /d 0 /f
echo Improve Windows Explorer Process Priority
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\explorer.exe\PerfOptions" /v CpuPriorityClass /t REG_DWORD /d 3 /f
echo Adjust Large System Cache
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v LargeSystemCache /t REG_DWORD /d 1 /f
echo Enabling No GUI Boot
bcdedit /set {current} quietboot on
echo Registry modifications are complete.
echo Steam Big Picture set as default shell.
echo Automatic logon enabled.
echo Boot UI disabled.
pause
echo Script completed successfully. echo Script completed successfully.
pause pause