diff --git a/Enable GamesDows v2.bat b/Enable GamesDows v2.bat index aec9291..c234146 100644 --- a/Enable GamesDows v2.bat +++ b/Enable GamesDows v2.bat @@ -56,95 +56,71 @@ if %errorlevel% neq 0 ( 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 :CHECK_LOGON - echo query user ^| find /i "%USERNAME%" ^>nul - echo if %errorlevel% neq 0 ^( - echo timeout /t 10 /nobreak ^>nul - echo goto CHECK_LOGON - 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 start C:\Windows\explorer.exe - 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 if %%errorlevel%% neq 0 ^( - 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 @echo off +echo Check if user is logged on +echo query user ^| find /i "%USERNAME%" ^>nul +echo if ERRORLEVEL 1 exit +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 timeout /t 20 /nobreak ^>nul +echo start C:\Windows\explorer.exe +echo timeout /t 10 /nobreak ^>nul +echo REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Shell /t REG_SZ /d "%STEAM_PATH%" /f +) > "%SCRIPT_PATH%" 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 -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% +IF EXIST "%XML_PATH%" DEL "%XML_PATH%" ( - echo ^ - echo ^ - echo ^ - echo ^!CURRENT_DATE!^ - echo ^"%USERNAME%"^ - echo ^Run DelayedExplorerStart.bat at logon.^ - echo ^ - echo ^ - echo ^ - echo ^true^ - echo ^ - echo ^ - echo ^ - echo ^ - echo ^%USERNAME%^ - echo ^InteractiveToken^ - echo ^HighestAvailable^ - echo ^ - echo ^ - echo ^ - echo ^IgnoreNew^ - echo ^false^ - echo ^false^ - echo ^true^ - echo ^true^ - echo ^false^ - echo ^ - echo ^true^ - echo ^false^ - echo ^ - echo ^true^ - echo ^false^ - echo ^false^ - echo ^PT72H^ - echo ^7^ - echo ^ - echo ^ - echo ^ - echo ^wscript.exe^ - echo ^"!VBS_PATH!"^ - echo ^ - echo ^ - echo ^ -) > "!XML_PATH!" -if %errorlevel% neq 0 ( - echo Error creating XML file - pause - exit /b 1 -) +echo ^ +echo ^ +echo ^ +echo ^2020-01-01T00:00:00^ +echo ^"%USERNAME%"^ +echo ^Run DelayedExplorerStart.bat at logon.^ +echo ^ +echo ^ +echo ^ +echo ^true^ +echo ^ +echo ^ +echo ^ +echo ^ +echo ^%USERNAME% +echo ^InteractiveToken^ +echo ^HighestAvailable^ +echo ^ +echo ^ +echo ^ +echo ^IgnoreNew^ +echo ^false^ +echo ^false^ +echo ^true^ +echo ^true^ +echo ^false^ +echo ^ +echo ^true^ +echo ^false^ +echo ^ +echo ^true^ +echo ^false^ +echo ^false^ +echo ^PT72H^ +echo ^7^ +echo ^ +echo ^ +echo ^ +echo ^wscript.exe^ +echo ^"%VBS_PATH%"^ +echo ^ +echo ^ +echo ^ +) > "%XML_PATH%" echo Delete the existing scheduled task if it exists schtasks /delete /tn "RunDelayedExplorerStart" /f @@ -157,5 +133,39 @@ if %errorlevel% neq 0 ( 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. pause