diff --git a/Enable GamesDows.bat b/Enable GamesDows.bat index 3d6432e..a3a6469 100644 --- a/Enable GamesDows.bat +++ b/Enable GamesDows.bat @@ -1,17 +1,6 @@ @echo off SETLOCAL EnableExtensions -echo Create the script folder if it doesn't exist -SET "SCRIPT_FOLDER=C:\GamesDows" -if not exist "%SCRIPT_FOLDER%" ( - mkdir "%SCRIPT_FOLDER%" - if %errorlevel% neq 0 ( - echo Failed to create script folder: %SCRIPT_FOLDER% - pause - exit /b 1 - ) -) - echo Setting Steam Big Picture as default shell echo Set Steam Big Picture as the default shell @@ -27,14 +16,12 @@ SETLOCAL EnableExtensions EnableDelayedExpansion echo Define the default Steam folder path and script names SET "STEAM_FOLDER=C:\Program Files (x86)\Steam" SET "SCRIPT_NAME=DelayedExplorerStart.bat" -SET "SCRIPT_FOLDER=C:\GamesDows" -SET "SCRIPT_PATH=%SCRIPT_FOLDER%\%SCRIPT_NAME%" +SET "SCRIPT_PATH=%STEAM_FOLDER%\%SCRIPT_NAME%" SET "EXPLORER_PATH=C:\Windows\explorer.exe" -SET XML_PATH="%SCRIPT_FOLDER%\DelayedExplorerStartTask.xml" echo Creating DelayedExplorerStart.bat script -echo Create the DelayedExplorerStart.bat script in the Script folder +echo Create the DelayedExplorerStart.bat script in the Steam folder ( echo @echo off echo Check if user is logged on @@ -42,7 +29,7 @@ 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 15 /nobreak ^>nul +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 @@ -56,20 +43,20 @@ echo Creating RunBatchSilently.vbs script :: Create VBScript to run the batch file silently @echo off SET "VBS_NAME=RunBatchSilently.vbs" -SET "VBS_PATH=%SCRIPT_FOLDER%\%VBS_NAME%" +SET "VBS_PATH=%STEAM_FOLDER%\%VBS_NAME%" echo Set WshShell = CreateObject("WScript.Shell") > "%VBS_PATH%" -echo WshShell.Run chr(34)^&"%SCRIPT_FOLDER%"^&chr(34), 0, True >> "%VBS_PATH%" +echo WshShell.Run chr(34)^&"%SCRIPT_PATH%"^&chr(34), 0, True >> "%VBS_PATH%" echo Set WshShell = Nothing >> "%VBS_PATH%" echo Create XML file for the scheduled task -SET XML_PATH="%SCRIPT_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%" ( echo ^ -echo ^ +echo ^ echo ^ echo ^2020-01-01T00:00:00^ echo ^"%USERNAME%"^ @@ -141,46 +128,8 @@ reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v VisualEffects /t REG_DWORD echo Increase File System Performance reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem" /v NtfsDisableLastAccessUpdate /t REG_DWORD /d 1 /f -@echo off - -REM Disable Fast Startup to ensure changes take effect -powercfg -h off - -REM Disable the lock screen (effective for Enterprise/Education) -reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Personalization" /v NoLockScreen /t REG_DWORD /d 1 /f - -REM Set the logon background to black by setting a custom background -reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\System" /v DisableLogonBackgroundImage /t REG_DWORD /d 1 /f - -REM Create the backgrounds folder if it doesn't exist -if not exist "C:\Windows\System32\oobe\info\backgrounds" ( - mkdir "C:\Windows\System32\oobe\info\backgrounds" -) - -REM Generate a black image using PowerShell -powershell -command "Add-Type -AssemblyName System.Drawing; $width = 1920; $height = 1080; $bitmap = New-Object System.Drawing.Bitmap $width, $height; $graphics = [System.Drawing.Graphics]::FromImage($bitmap); $black = [System.Drawing.Brushes]::Black; $graphics.FillRectangle($black, 0, 0, $width, $height); $bitmap.Save('C:\Windows\System32\oobe\info\backgrounds\backgroundDefault.jpg', [System.Drawing.Imaging.ImageFormat]::Jpeg); $graphics.Dispose(); $bitmap.Dispose();" - -REM Set the custom black background image for the lock screen -reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Personalization" /v LockScreenImage /t REG_SZ /d "C:\Windows\System32\oobe\info\backgrounds\backgroundDefault.jpg" /f - -REM Do not display last signed-in user name -reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v DontDisplayLastUserName /t REG_DWORD /d 1 /f - -REM Do not display the username and other information during sign-in -reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v DontDisplayLockedUserId /t REG_DWORD /d 3 /f - -REM Disable Windows animations during sign-in -reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v DisableStatusMessages /t REG_DWORD /d 1 /f - -REM Disable verbose status messages -reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v VerboseStatus /t REG_DWORD /d 0 /f - -REM Disable the Welcome screen and reduce animation delay -reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v DelayedDesktopSwitchTimeout /t REG_DWORD /d 0 /f - -REM Disable lock screen transitions -reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\System" /v DisableLockScreenAppNotifications /t REG_DWORD /d 1 /f -reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\System" /v DisableLogonUIAnimations /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 @@ -193,6 +142,9 @@ reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Mem echo Enabling No GUI Boot bcdedit /set {current} quietboot on +PowerShell -Command "Enable-WindowsOptionalFeature -Online -FeatureName 'DeviceLockdown' -All" +PowerShell -Command "Enable-WindowsOptionalFeature -Online -FeatureName 'Custom Logon' -All" + echo Registry modifications are complete. echo Steam Big Picture set as default shell. echo Automatic logon enabled.