Skip to content
TheChatArchiveThe Chat Archive
o1-mini-2024-09-12· OpenAIAi2 WildChat-4.8M (AI2)

Добавь в меню пункт - Enable Debug (если ее включить, то будут показывать все сообщения…

  1. User

    Добавь в меню пункт - Enable Debug (если ее включить, то будут показывать все сообщения от системы, тип не только от оптимизации, и если включить дебаг, то название кнопки Enable Debug изменится на Disable Debug (НАПИШИ ФУЛЛ КОД)

    @echo off echo. REM Проверка на запуск от имени администратора net session >nul 2>&1 if %errorLevel% neq 0 ( cls echo This script must be run as administrator. pause exit /b )

    call :USER_DEFINED REM Set processor affinities; if not set, leave as is :processaffinity REM CREDIT TO SPDLL for the fastest code if defined affinity ( if not %affinity% GTR 0 goto INVALID_AFFINITY PowerShell -NoLogo -NoProfile -NonInteractive -Command "Get-Process dwm,audiosvchost,audiodg,lsass,svchost,WmiPrvSE | ForEach-Object {$_.ProcessorAffinity=%affinity%}" ) :INVALID_AFFINITY REM Set winlogon to normal priority to prevent child processes from inheriting high priority wmic process where name="winlogon.exe" call setpriority 32 >nul 2>&1 REM Clear temporary files rd /s /q "%temp%" 2>nul mkdir "%userprofile%\AppData\Local\Temp" >nul 2>&1 exit /b

    :USER_DEFINED wmic process where name="dwm.exe" call setpriority 32 >nul 2>&1 wmic process where name="lsass.exe" call setpriority 64 >nul 2>&1 wmic process where name="svchost.exe" call setpriority 64 >nul 2>&1 wmic process where name="WmiPrvSE.exe" call setpriority 64 >nul 2>&1 @echo off REM Set encoding and disable command display chcp 65001 >nul cls title Windows Optimization by Doxile REM Цветовые коды REM 0 = Черный 1 = Синий 2 = Зеленый REM 3 = Аква 4 = Красный 5 = Пурпурный REM 6 = Желтый 7 = Белый 8 = Серый REM 9 = Светло-синий 10 = Светло-зеленый и т.д. set "COLOR_TITLE=0A" set "COLOR_MENU=0E" set "COLOR_ERROR=0C" set "COLOR_SUCCESS=0A" set "COLOR_PROMPT=0B" REM Количество примененных оптимизаций set "optimization_count=60" REM Увеличено количество оптимизаций REM Функция для отображения меню :menu cls echo °º¤ø,¸¸,ø¤º°°º¤ø,¸,ø¤°º¤ø,¸¸,ø¤º°°º¤ø,¸,ø¤°º¤ø,¸¸,ø¤º°°º¤ø,¸,ø¤°º¤ø,¸¸,ø¤º°,ø¤°º¤ø,¸¸,ø¤º° echo. echo Windows Optimization by Doxile echo Total optimizations in the script: %optimization_count% echo. echo °º¤ø,¸¸,ø¤º°°º¤ø,¸,ø¤°º¤ø,¸¸,ø¤º°°º¤ø,¸,ø¤°º¤ø,¸¸,ø¤º°°º¤ø,¸,ø¤°º¤ø,¸¸,ø¤º°,ø¤°º¤ø,¸¸,ø¤º° echo. echo 1. Apply Windows Optimizations echo 2. Restore Default Settings echo 3. Enable Windows Boost echo 4. Disable Windows Boost echo 5. Clean Disk and Temporary Files echo 6. Update System Files and Drivers echo 7. Create Restore Point echo 8. Optimize Network Settings echo 0. Exit echo. echo °º¤ø,¸¸,ø¤º°°º¤ø,¸,ø¤°º¤ø,¸¸,ø¤º°°º¤ø,¸,ø¤°º¤ø,¸¸,ø¤º°`°º¤ø,¸,ø¤°º¤ø,¸¸,ø¤º°,ø¤°º¤ø,¸¸,ø¤º° echo. REM Запрос выбора пользователя color %COLOR_PROMPT% set /p "choice=Enter your choice: " color 07 REM Обработка выбора пользователя if "%choice%"=="1" goto optimizations if "%choice%"=="2" goto restore_defaults if "%choice%"=="3" goto boost_enable if "%choice%"=="4" goto boost_disable if "%choice%"=="5" goto clean_disk if "%choice%"=="6" goto update_system if "%choice%"=="7" goto create_restore if "%choice%"=="8" goto optimize_network if "%choice%"=="0" goto exit_script echo. color %COLOR_ERROR% echo Invalid selection. Please try again. color 07 timeout /t 2 /nobreak >nul goto menu

    REM Optimization Function :optimizations cls color %COLOR_MENU% echo. echo Applying Windows optimizations... echo. REM Stop unnecessary services echo Stopping unnecessary services... net stop "SysMain" >nul 2>&1 net stop "Superfetch" >nul 2>&1 net stop "Print Spooler" >nul 2>&1 net stop "Fax" >nul 2>&1 net stop "wuauserv" >nul 2>&1 net stop "BITS" >nul 2>&1 net stop "WMPNetworkSvc" >nul 2>&1 net stop "ConnectedUserSharedExperiences_32771" >nul 2>&1 net stop "Spooler" >nul 2>&1 REM Remove programs from startup echo. echo Cleaning startup... reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /f >nul 2>&1 reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /f >nul 2>&1 REM Optimize visual effects echo. echo Optimizing visual effects... reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects" /v VisualFXSetting /t REG_DWORD /d 2 /f >nul reg add "HKCU\SOFTWARE\Microsoft\Windows\DWM" /v EnableTransparency /t REG_DWORD /d 0 /f >nul REM Disable hibernation and other features echo. echo Disabling hibernation and search features... powercfg /hibernate off >nul 2>&1 sc config "Windows Search" start=disabled >nul 2>&1 sc config "SysMain" start=disabled >nul 2>&1 REM Disable Game DVR and Delivery Optimization echo. echo Disabling Game DVR and Delivery Optimization... reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\GameDVR" /v AllowGameDVR /t REG_DWORD /d 0 /f >nul reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization" /v DODownloadMode /t REG_DWORD /d 0 /f >nul reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization" /v DOUploadMode /t REG_DWORD /d 0 /f >nul REM Disable background tasks echo. echo Disabling scheduled tasks... for %%a in ( "Microsoft\Windows\Defrag\ScheduledDefrag" "Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser" "Microsoft\Windows\Application Experience\ProgramDataUpdater" "Microsoft\Windows\Application Experience\StartupAppTask" "Microsoft\Windows\Device Information\Device" "Microsoft\Windows\Diagnosis\Scheduled" "Microsoft\Windows\Diagnosis\RecommendedTroubleshootingScanner" "Microsoft\Windows\DiskFootprint\Diagnostics" "Microsoft\Windows\DiskFootprint\StorageSense" "Microsoft\Windows\Feedback\Siuf\DmClientOnScenarioDownload" "Microsoft\Windows\Feedback\Siuf\DmClient" "Microsoft\Windows\International\Synchronize Language Settings" "Microsoft\Windows\LanguageComponentsInstaller\Installation" "Microsoft\Windows\LanguageComponentsInstaller\ReconcileLanguageResources" "Microsoft\Windows\Maps\MapsUpdateTask" "Microsoft\Windows\Maps\MapsToastTask" "Microsoft\Windows\PushToInstall\Registration" "Microsoft\Windows\Setup\SetupCleanupTask" "Microsoft\Windows\Speech\SpeechModelDownloadTask" "Microsoft\Windows\Windows Error Reporting\QueueReporting" "Microsoft\Windows\WindowsColorSystem\Calibration Loader" "Microsoft\Windows\Work Folders\Work Folders Logon Synchronization" "Microsoft\Windows\MemoryDiagnostic\ProcessMemoryDiagnosticEvents" "Microsoft\Windows\MemoryDiagnostic\RunFullMemoryDiagnostic" ) do schtasks /change /tn "%%a" /disable >nul 2>&1 REM Optimize power and performance settings echo. echo Optimizing power and performance settings... powercfg /setactive 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c >nul 2>&1 reg add "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\PriorityControl" /v "Win32PrioritySeparation" /t REG_DWORD /d 38 /f >nul REM Set process priorities echo. echo Setting process priorities... for %%P in ("BstkSVC.exe" "HD-Agent.exe" "HD-Player.exe" "BlueStacks.exe") do ( reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options%%~P\PerfOptions" /v "CpuPriorityClass" /t REG_DWORD /d 3 /f >nul ) REM Optimize multimedia profiles echo. echo Optimizing multimedia profiles... reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Games" /v "GPU Priority" /t REG_DWORD /d 8 /f >nul reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Games" /v "Priority" /t REG_DWORD /d 6 /f >nul reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Games" /v "Scheduling Category" /t REG_SZ /d "High" /f >nul reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Games" /v "SFIO Priority" /t REG_SZ /d "High" /f >nul reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\PowerThrottling" /v "PowerThrottlingOff" /t REG_DWORD /d 1 /f >nul reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile" /v "SystemResponsiveness" /t REG_DWORD /d 0 /f >nul reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile" /v "NetworkThrottlingIndex" /t REG_DWORD /d 0xffffffff /f >nul REM Configure USB settings for performance echo. echo Configuring USB settings... for /f "tokens=2 delims==" %%a in ('WMIC PATH Win32_USBHub GET DeviceID /VALUE ^| find "="') do ( for %%b in ("EnhancedPowerManagementEnabled" "AllowIdleIrpInD3" "SelectiveSuspendOn" "DeviceSelectiveSuspended" "SelectiveSuspendEnabled") do ( reg add "HKLM\SYSTEM\CurrentControlSet\Enum%%a\Device Parameters" /v "%%~b" /t REG_DWORD /d 0 /f >nul 2>&1 ) ) REM Disable Game Bar and game settings echo. echo Disabling Game Bar and game settings... reg add "HKCU\SOFTWARE\Microsoft\GameBar" /v "ShowStartupPanel" /t REG_DWORD /d 0 /f >nul reg add "HKCU\SOFTWARE\Microsoft\GameBar" /v "GamePanelStartupTipIndex" /t REG_DWORD /d 3 /f >nul reg add "HKCU\SOFTWARE\Microsoft\GameBar" /v "AllowAutoGameMode" /t REG_DWORD /d 0 /f >nul reg add "HKCU\SOFTWARE\Microsoft\GameBar" /v "AutoGameModeEnabled" /t REG_DWORD /d 0 /f >nul reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\GameDVR" /v "AllowGameDVR" /t REG_DWORD /d 0 /f >nul reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR" /v "AppCaptureEnabled" /t REG_DWORD /d 0 /f >nul REM Additional optimizations echo. echo Applying additional optimizations... REM Disable search indexing reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" /v "GatherSystemTags" /t REG_DWORD /d 0 /f >nul reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" /v "GatherExtendedProperties" /t REG_DWORD /d 0 /f >nul reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" /v "IndexingPaused" /t REG_DWORD /d 1 /f >nul REM Disable notifications reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\PushNotifications" /v "ToastEnabled" /t REG_DWORD /d 0 /f >nul reg add "HKCU\Software\Policies\Microsoft\Windows\Explorer" /v "DisableNotificationCenter" /t REG_DWORD /d 1 /f >nul REM Disable Windows advertising elements reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SystemPaneSuggestionsEnabled" /t REG_DWORD /d 0 /f >nul reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SubscribedContent-338388Enabled" /t REG_DWORD /d 0 /f >nul reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SubscribedContent-338389Enabled" /t REG_DWORD /d 0 /f >nul REM Disable telemetry reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\DataCollection" /v "AllowTelemetry" /t REG_DWORD /d 0 /f >nul REM Disable background applications reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications" /v "GlobalUserDisabled" /t REG_DWORD /d 1 /f >nul REM Disable automatic driver updates reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\DriverSearching" /v "SearchOrderConfig" /t REG_DWORD /d 0 /f >nul REM Disable automatic Windows updates reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v "NoAutoUpdate" /t REG_DWORD /d 1 /f >nul REM Configure virtual memory settings echo. echo Configuring virtual memory settings... reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v "PagingFiles" /t REG_MULTI_SZ /d "C:\pagefile.sys 4096 8192" /f >nul REM Optimize registry for faster startup reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Serialize" /v "StartupDelayInMSec" /t REG_DWORD /d 0 /f >nul REM Clean prefetch and temporary files echo. REM Additional optimizations (additional steps) echo. echo Applying additional optimizations (additional steps)... REM Step 1: Disable UAC and SmartScreen reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v "EnableLUA" /t REG_DWORD /d 0 /f >nul reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v "PromptOnSecureDesktop" /t REG_DWORD /d 0 /f >nul reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v "ConsentPromptBehaviorAdmin" /t REG_DWORD /d 0 /f >nul reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" /v SmartScreenEnabled /t REG_SZ /d "Off" /f >nul REM Step 2: Disable CPU reserve for background processes reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile" /v "SystemResponsiveness" /t REG_DWORD /d 0a /f >nul REM Step 3: Configure NetworkThrottlingIndex reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile" /v "NetworkThrottlingIndex" /t REG_DWORD /d 0a /f >nul REM Step 4: Disable Store app auto-updates reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore" /v "AutoDownload" /t REG_DWORD /d 2 /f >nul REM Step 5: Reduce timeout durations reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v "AutoEndTasks" /t REG_SZ /d "1" /f >nul reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v "HungAppTimeout" /t REG_SZ /d "1000" /f >nul reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v "WaitToKillAppTimeout" /t REG_SZ /d "2000" /f >nul reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v "LowLevelHooksTimeout" /t REG_SZ /d "1000" /f >nul reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v "MenuShowDelay" /t REG_SZ /d "0" /f >nul REM Step 6: Set desktop background quality reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v "JPEGImportQuality" /t REG_DWORD /d 80 /f >nul REM Step 7: Increase system cache reg add "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Memory Management" /v "LargeSystemCache" /t REG_DWORD /d 1 /f >nul REM Step 8: Reduce shutdown timeout reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control" /v "WaitToKillServiceTimeout" /t REG_SZ /d "10000" /f >nul REM Step 9: Disable additional scheduled tasks call :disable_additional_tasks REM Step 10: Disable unnecessary devices using DevManView call :disable_devices REM Step 11: Disable more scheduled tasks call :disable_more_tasks REM Step 12: Configure OpenGL call :configure_opengl REM Step 13: Additional OpenGL settings call :additional_opengl_settings REM Step 14: Set GPU environment variables call :set_gpu_env REM Step 15: Protect OpenGL DLL call :protect_opengl REM Step 16: Disable Remote Registry Service echo. echo Disabling Remote Registry Service... sc config "RemoteRegistry" start=disabled >nul 2>&1 sc stop "RemoteRegistry" >nul 2>&1 REM Step 17: Disable Windows Tips echo. echo Disabling Windows Tips... reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SubscribedContent-338389Enabled" /t REG_DWORD /d 0 /f >nul reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SubscribedContent-338384Enabled" /t REG_DWORD /d 0 /f >nul reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SubscribedContent-338387Enabled" /t REG_DWORD /d 0 /f >nul REM Step 18: Disable Transparency Effects echo. echo Disabling Transparency Effects... reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize" /v "EnableTransparency" /t REG_DWORD /d 0 /f >nul REM Step 19: Disable Animations echo. echo Disabling Window Animations... reg add "HKCU\Control Panel\Desktop" /v "WindowAnimation" /t REG_SZ /d "0" /f >nul reg add "HKCU\Control Panel\Desktop" /v "MinAnimate" /t REG_SZ /d "0" /f >nul REM Step 20: Disable Shake Window Effect echo. echo Disabling Shake Window Effect... reg add "HKCU\Control Panel\Desktop" /v "ClientVisualStylePrefe" /t REG_SZ /d "0" /f >nul reg add "HKCU\Control Panel\Desktop" /v "WindowArrangementActive" /t REG_SZ /d "0" /f >nul REM Finish optimizations echo. color %COLOR_SUCCESS% echo Optimizations successfully applied! color 07 timeout /t 3 /nobreak >nul goto menu

    REM Function to disable additional tasks (Step 9) :disable_additional_tasks echo. echo Disabling additional scheduled tasks (Step 9)... REM Insert user step 9 commands here schtasks /change /TN "Microsoft\Windows.NET Framework.NET Framework NGEN v4.0.30319" /DISABLE >nul 2>&1 schtasks /change /TN "Microsoft\Windows.NET Framework.NET Framework NGEN v4.0.30319 64" /DISABLE >nul 2>&1 schtasks /change /TN "Microsoft\Windows.NET Framework.NET Framework NGEN v4.0.30319 64 Critical" /DISABLE >nul 2>&1 schtasks /change /TN "Microsoft\Windows.NET Framework.NET Framework NGEN v4.0.30319 Critical" /DISABLE >nul 2>&1 schtasks /change /TN "Microsoft\Windows\ApplicationData\appuriverifierdaily" /DISABLE >nul 2>&1 schtasks /change /TN "Microsoft\Windows\ApplicationData\appuriverifierinstall" /DISABLE >nul 2>&1 schtasks /Change /TN "Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser" /DISABLE >nul 2>&1 schtasks /Change /TN "Microsoft\Windows\Application Experience\ProgramDataUpdater" /DISABLE >nul 2>&1 schtasks /Change /TN "Microsoft\Windows\Application Experience\StartupAppTask" /DISABLE >nul 2>&1 schtasks /change /TN "Microsoft\Windows\Device Information\Device" /DISABLE >nul 2>&1 schtasks /change /TN "Microsoft\Windows\Diagnosis\Scheduled" /DISABLE >nul 2>&1 schtasks /change /TN "Microsoft\Windows\Diagnosis\RecommendedTroubleshootingScanner" /DISABLE >nul 2>&1 schtasks /change /TN "Microsoft\Windows\DiskFootprint\Diagnostics" /DISABLE >nul 2>&1 schtasks /change /TN "Microsoft\Windows\DiskFootprint\StorageSense" /DISABLE >nul 2>&1 schtasks /change /TN "Microsoft\Windows\Feedback\Siuf\DmClientOnScenarioDownload" /DISABLE >nul 2>&1 schtasks /change /TN "Microsoft\Windows\Feedback\Siuf\DmClient" /DISABLE >nul 2>&1 schtasks /change /TN "Microsoft\Windows\International\Synchronize Language Settings" /DISABLE >nul 2>&1 schtasks /change /TN "Microsoft\Windows\LanguageComponentsInstaller\Installation" /DISABLE >nul 2>&1 schtasks /change /TN "Microsoft\Windows\LanguageComponentsInstaller\ReconcileLanguageResources" /DISABLE >nul 2>&1 schtasks /change /TN "Microsoft\Windows\Maps\MapsUpdateTask" /DISABLE >nul 2>&1 schtasks /Change /TN "Microsoft\Windows\Maps\MapsToastTask" /DISABLE >nul 2>&1 schtasks /change /TN "Microsoft\Windows\PushToInstall\Registration" /DISABLE >nul 2>&1 schtasks /change /TN "Microsoft\Windows\Setup\SetupCleanupTask" /DISABLE >nul 2>&1 schtasks /change /TN "Microsoft\Windows\Speech\SpeechModelDownloadTask" /DISABLE >nul 2>&1 schtasks /change /TN "Microsoft\Windows\Windows Error Reporting\QueueReporting" /DISABLE >nul 2>&1 schtasks /change /TN "Microsoft\Windows\WindowsColorSystem\Calibration Loader" /DISABLE >nul 2>&1 schtasks /change /TN "Microsoft\Windows\Work Folders\Work Folders Logon Synchronization" /DISABLE >nul 2>&1 echo Additional tasks disabled successfully! goto :eof

    REM Function to disable devices using DevManView (Step 10) :disable_devices echo. echo Disabling unnecessary devices (Step 10)... REM Ensure DevManView.exe is in the same directory as the script if not exist "%cd%\devmanview\devmanview.exe" ( echo DevManView.exe not found. Skipping device disabling. goto :eof ) "%cd%\devmanview\devmanview.exe" /disable "UMBus Root Bus Enumerator" >nul 2>&1 "%cd%\devmanview\devmanview.exe" /disable "Root Print Queue" >nul 2>&1 "%cd%\devmanview\devmanview.exe" /disable "NDIS Virtual Network Adapter Enumerator" >nul 2>&1 "%cd%\devmanview\devmanview.exe" /disable "Microsoft Virtual Drive Enumerator" >nul 2>&1 "%cd%\devmanview\devmanview.exe" /disable "Microsoft Hyper-V Virtualization Infrastructure Driver" >nul 2>&1 "%cd%\devmanview\devmanview.exe" /disable "Microsoft GS Wavetable Synth" >nul 2>&1 "%cd%\devmanview\devmanview.exe" /disable "Microsoft Device Association Root Enumerator" >nul 2>&1 "%cd%\devmanview\devmanview.exe" /disable "Composite Bus Enumerator" >nul 2>&1 "%cd%\devmanview\devmanview.exe" /disable "Microsoft UEFI-Compliant System" >nul 2>&1 "%cd%\devmanview\devmanview.exe" /disable "System board" >nul 2>&1 "%cd%\devmanview\devmanview.exe" /disable "SM Bus Controller" >nul 2>&1 "%cd%\devmanview\devmanview.exe" /disable "Motherboard resources" >nul 2>&1 "%cd%\devmanview\devmanview.exe" /disable "PCI Encryption/Decryption Controller" >nul 2>&1 "%cd%\devmanview\devmanview.exe" /disable "Microsoft Windows Management Interface for ACPI" >nul 2>&1 "%cd%\devmanview\devmanview.exe" /disable "High precision event timer" >nul 2>&1 "%cd%\devmanview\devmanview.exe" /disable "Base System Device" >nul 2>&1 "%cd%\devmanview\devmanview.exe" /disable "PCI Data Acquisition and Signal Processing Controller" >nul 2>&1 "%cd%\devmanview\devmanview.exe" /disable "PCI Simple Communications Controller" >nul 2>&1 "%cd%\devmanview\devmanview.exe" /disable "PCI Device" >nul 2>&1 "%cd%\devmanview\devmanview.exe" /disable "Unknown Device" >nul 2>&1 "%cd%\devmanview\devmanview.exe" /disable "PCI Memory Controller" >nul 2>&1 "%cd%\devmanview\devmanview.exe" /disable "PCI standard RAM Controller" >nul 2>&1 "%cd%\devmanview\devmanview.exe" /disable "ACPI Processor Aggregator" >nul 2>&1 "%cd%\devmanview\devmanview.exe" /disable "ACPI Wake Alarm" >nul 2>&1 "%cd%\devmanview\devmanview.exe" /disable "System Speaker" >nul 2>&1 "%cd%\devmanview\devmanview.exe" /disable "System Timer" >nul 2>&1 "%cd%\devmanview\devmanview.exe" /disable "WAN Miniport (IKEv2)" >nul 2>&1 "%cd%\devmanview\devmanview.exe" /disable "WAN Miniport (IP)" >nul 2>&1 "%cd%\devmanview\devmanview.exe" /disable "WAN Miniport (IPv6)" >nul 2>&1 "%cd%\devmanview\devmanview.exe" /disable "WAN Miniport (L2TP)" >nul 2>&1 "%cd%\devmanview\devmanview.exe" /disable "WAN Miniport (Network Monitor)" >nul 2>&1 "%cd%\devmanview\devmanview.exe" /disable "WAN Miniport (PPPOE)" >nul 2>&1 "%cd%\devmanview\devmanview.exe" /disable "WAN Miniport (PPTP)" >nul 2>&1 "%cd%\devmanview\devmanview.exe" /disable "WAN Miniport (SSTP)" >nul 2>&1 "%cd%\devmanview\devmanview.exe" /disable "Programmable Interrupt Controller" >nul 2>&1 "%cd%\devmanview\devmanview.exe" /disable "Numeric Data Processor" >nul 2>&1 "%cd%\devmanview\devmanview.exe" /disable "Microsoft Kernel Debug Network Adapter" >nul 2>&1 "%cd%\devmanview\devmanview.exe" /disable "HID-compliant consumer control device" >nul 2>&1 "%cd%\devmanview\devmanview.exe" /disable "Plug and Play Software Device Enumerator" >nul 2>&1 "%cd%\devmanview\devmanview.exe" /disable "Direct memory access controller" >nul 2>&1 echo Devices disabled successfully! goto :eof

    REM Function to disable more scheduled tasks (Step 11) :disable_more_tasks echo. echo Disabling additional scheduled tasks (Step 11)... REM Insert step 11 commands here schtasks /Change /Disable /TN "\MicrosoftEdgeUpdateTaskMachineCore" >nul 2>&1 schtasks /Change /Disable /TN "\MicrosoftEdgeUpdateTaskMachineUA" >nul 2>&1 schtasks /Change /Disable /TN "\Microsoft\Windows\Power Efficiency Diagnostics\AnalyzeSystem" >nul 2>&1 schtasks /Change /Disable /TN "\Microsoft\Windows\Windows Error Reporting\QueueReporting" >nul 2>&1 schtasks /Change /Disable /TN "\Microsoft\Windows\DiskFootprint\Diagnostics" >nul 2>&1 schtasks /Change /Disable /TN "\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser" >nul 2>&1 schtasks /Change /Disable /TN "\Microsoft\Windows\Application Experience\StartupAppTask" >nul 2>&1 schtasks /Change /Disable /TN "\Microsoft\Windows\Autochk\Proxy" >nul 2>&1 schtasks /Change /Disable /TN "\Microsoft\Windows\Application Experience\PcaPatchDbTask" /DISABLE >nul 2>&1 schtasks /Change /Disable /TN "\Microsoft\Windows\BrokerInfrastructure\BgTaskRegistrationMaintenanceTask" /DISABLE >nul 2>&1 schtasks /Change /Disable /TN "\Microsoft\Windows\CloudExperienceHost\CreateObjectTask" /DISABLE >nul 2>&1 schtasks /Change /Disable /TN "\Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticDataCollector" /DISABLE >nul 2>&1 schtasks /Change /Disable /TN "\Microsoft\Windows\Defrag\ScheduledDefrag" /DISABLE >nul 2>&1 schtasks /Change /Disable /TN "\Microsoft\Windows\DiskFootprint\StorageSense" /DISABLE >nul 2>&1 schtasks /Change /Disable /TN "\MicrosoftEdgeUpdateBrowserReplacementTask" /DISABLE >nul 2>&1 schtasks /Change /Disable /TN "\Microsoft\Windows\Registry\RegIdleBackup" /DISABLE >nul 2>&1 schtasks /Change /Disable /TN "\Microsoft\Windows\Windows Filtering Platform\BfeOnServiceStartTypeChange" /DISABLE >nul 2>&1 schtasks /Change /Disable /TN "\Microsoft\Windows\Shell\IndexerAutomaticMaintenance" /DISABLE >nul 2>&1 schtasks /Change /Disable /TN "\Microsoft\Windows\SoftwareProtectionPlatform\SvcRestartTaskNetwork" /DISABLE >nul 2>&1 schtasks /Change /Disable /TN "\Microsoft\Windows\SoftwareProtectionPlatform\SvcRestartTaskLogon" /DISABLE >nul 2>&1 schtasks /Change /Disable /TN "\Microsoft\Windows\StateRepository\MaintenanceTasks" /DISABLE >nul 2>&1 schtasks /Change /Disable /TN "\Microsoft\Windows\UpdateOrchestrator\Report policies" /DISABLE >nul 2>&1 schtasks /Change /Disable /TN "\Microsoft\Windows\UpdateOrchestrator\Schedule Scan Static Task" /DISABLE >nul 2>&1 schtasks /Change /Disable /TN "\Microsoft\Windows\UpdateOrchestrator\UpdateModelTask" /DISABLE >nul 2>&1 schtasks /Change /Disable /TN "\Microsoft\Windows\UpdateOrchestrator\USO_UxBroker" /DISABLE >nul 2>&1 schtasks /Change /Disable /TN "\Microsoft\Windows\UpdateOrchestrator\Schedule Work" /DISABLE >nul 2>&1 schtasks /Change /Disable /TN "\Microsoft\Windows\UPnP\UPnPHostConfig" /DISABLE >nul 2>&1 schtasks /Change /Disable /TN "\Microsoft\Windows\RetailDemo\CleanupOfflineContent" /DISABLE >nul 2>&1 schtasks /Change /Disable /TN "\Microsoft\Windows\Shell\FamilySafetyMonitor" /DISABLE >nul 2>&1 schtasks /Change /Disable /TN "\Microsoft\Windows\InstallService\ScanForUpdates" /DISABLE >nul 2>&1 schtasks /Change /Disable /TN "\Microsoft\Windows\InstallService\ScanForUpdatesAsUser" /DISABLE >nul 2>&1 schtasks /Change /Disable /TN "\Microsoft\Windows\InstallService\SmartRetry" /DISABLE >nul 2>&1 schtasks /Change /Disable /TN "\Microsoft\Windows\International\Synchronize Language Settings" /DISABLE >nul 2>&1 schtasks /Change /Disable /TN "\Microsoft\Windows\MemoryDiagnostic\ProcessMemoryDiagnosticEvents" /DISABLE >nul 2>&1 schtasks /Change /Disable /TN "\Microsoft\Windows\MemoryDiagnostic\RunFullMemoryDiagnostic" >nul 2>&1 schtasks /Change /Disable /TN "\Microsoft\Windows\Multimedia\Microsoft\Windows\Multimedia" >nul 2>&1 schtasks /Change /Disable /TN "\Microsoft\Windows\Printing\EduPrintProv" >nul 2>&1 schtasks /Change /Disable /TN "\Microsoft\Windows\RemoteAssistance\RemoteAssistanceTask" >nul 2>&1 schtasks /Change /Disable /TN "\Microsoft\Windows\Ras\MobilityManager" /DISABLE >nul 2>&1 schtasks /Change /Disable /TN "\Microsoft\Windows\PushToInstall\LoginCheck" /DISABLE >nul 2>&1 schtasks /Change /Disable /TN "\Microsoft\Windows\Time Synchronization\SynchronizeTime" /DISABLE >nul 2>&1 schtasks /Change /Disable /TN "\Microsoft\Windows\Time Synchronization\ForceSynchronizeTime" /DISABLE >nul 2>&1 schtasks /Change /Disable /TN "\Microsoft\Windows\Time Zone\SynchronizeTimeZone" /DISABLE >nul 2>&1 schtasks /Change /Disable /TN "\Microsoft\Windows\UpdateOrchestrator\Schedule Scan" /DISABLE >nul 2>&1 schtasks /Change /Disable /TN "\Microsoft\Windows\WaaSMedic\PerformRemediation" /DISABLE >nul 2>&1 schtasks /Change /Disable /TN "\Microsoft\Windows\DiskCleanup\SilentCleanup" /DISABLE >nul 2>&1 schtasks /Change /Disable /TN "\Microsoft\Windows\Diagnosis\Scheduled" /DISABLE >nul 2>&1 schtasks /Change /Disable /TN "\Microsoft\Windows\Wininet\CacheTask" /DISABLE >nul 2>&1 schtasks /Change /Disable /TN "\Microsoft\Windows\Device Setup\Metadata Refresh" >nul 2>&1 schtasks /Change /Disable /TN "\Microsoft\Windows\Mobile Broadband Accounts\MNO Metadata Parser" >nul 2>&1 schtasks /Change /Disable /TN "\Microsoft\Windows\WindowsUpdate\Scheduled Start" /DISABLE >nul 2>&1 echo. goto :eof

    REM Function to configure OpenGL (Step 12) :configure_opengl echo. echo Configuring OpenGL (Step 12)... REM Example OpenGL configuration adjusted for Batch set "OPENGL_32=%windir%\system32\opengl32.dll" set "OPENGL_DEBUG=1" echo OPENGL_32="%OPENGL_32%" echo OPENGL_DEBUG="%OPENGL_DEBUG%" REM Add additional commands here if necessary goto :eof

    REM Function for additional OpenGL settings (Step 13) :additional_opengl_settings echo. echo Applying additional OpenGL settings (Step 13)... reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\MSOpenGL" /v "DisableAsync" /t REG_DWORD /d 1 /f >nul reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\MSOpenGL" /v "EnableMultisampleBuffers" /t REG_DWORD /d 1 /f >nul reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\MSOpenGL" /v "EnableSurfaceMemoryManagement" /t REG_DWORD /d 1 /f >nul reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\MSOpenGL" /v "MaxWGLSwapInterval" /t REG_DWORD /d 1 /f >nul goto :eof

    REM Function to set GPU environment variables (Step 14) :set_gpu_env echo. echo Setting GPU environment variables (Step 14)... setx GPU_MAX_HEAP_SIZE 100 >nul setx GPU_MAX_ALLOC_PERCENT 100 >nul setx GPU_SINGLE_ALLOC_PERCENT 100 >nul goto :eof

    REM Function to protect OpenGL DLL (Step 15) :protect_opengl echo. echo Protecting OpenGL DLL (Step 15)... set "OPENGL_32_DLL=%windir%\System32\opengl32.dll" set "OPENGL_32_DLL_SIZE=2576980377" if exist "%OPENGL_32_DLL%.bak" ( echo Backup already exists. ) else ( copy "%OPENGL_32_DLL%" "%OPENGL_32_DLL%.bak" >nul 2>&1 fsutil file setvaliddata "%OPENGL_32_DLL%" %OPENGL_32_DLL_SIZE% >nul 2>&1 ) goto :eof

    REM Function to enable Windows Boost :boost_enable cls echo Enabling Windows Boost... color %COLOR_MENU% echo. REM Apply high-performance mode powercfg -setactive SCHEME_MIN >nul 2>&1 REM Terminate explorer.exe process taskkill /f /im explorer.exe >nul 2>&1 REM Additional Boost optimizations echo. echo Applying additional Boost settings... REM Increase process priorities wmic process where name="chrome.exe" call setpriority 128 >nul 2>&1 wmic process where name="firefox.exe" call setpriority 128 >nul 2>&1 REM Disable visual effects for speed reg add "HKCU\Control Panel\Desktop" /v "WindowAnimation" /t REG_SZ /d "0" /f >nul reg add "HKCU\Control Panel\Desktop" /v "MinAnimate" /t REG_SZ /d "0" /f >nul REM Enable maximum graphics performance (for systems with discrete graphics) echo. echo Configuring graphics settings for maximum performance... reg add "HKCU\Software\Microsoft\DirectDraw\Renderer" /v "DefaultAdapter" /t REG_DWORD /d 0 /f >nul reg add "HKCU\Software\Microsoft\DirectDraw\Renderer" /v "UseHardware" /t REG_DWORD /d 1 /f >nul REM Disable background services echo. echo Disabling background services... sc stop "DiagTrack" >nul 2>&1 sc config "DiagTrack" start=disabled >nul 2>&1 sc stop "WerSvc" >nul 2>&1 sc config "WerSvc" start=disabled >nul 2>&1 REM Disable unnecessary Windows features reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoWindowsUpdate" /t REG_DWORD /d 1 /f >nul REM Disable Windows Tips and Notifications echo. echo Disabling Windows Tips and Notifications... reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SystemPaneSuggestionsEnabled" /t REG_DWORD /d 0 /f >nul reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SubscribedContent-338389Enabled" /t REG_DWORD /d 0 /f >nul REM Finish Boost echo. color %COLOR_SUCCESS% echo Windows Boost enabled and optimizations applied! color 07 timeout /t 3 /nobreak >nul goto menu

    REM Function to disable Windows Boost :boost_disable cls echo Disabling Windows Boost... color %COLOR_MENU% echo. REM Return to balanced power plan powercfg -setactive SCHEME_BALANCED >nul 2>&1 REM Start explorer.exe process start explorer.exe >nul 2>&1 REM Restore visual effects echo. echo Restoring visual settings... reg add "HKCU\Control Panel\Desktop" /v "WindowAnimation" /t REG_SZ /d "1" /f >nul reg add "HKCU\Control Panel\Desktop" /v "MinAnimate" /t REG_SZ /d "1" /f >nul REM Restore process priorities wmic process where name="chrome.exe" call setpriority 32 >nul 2>&1 wmic process where name="firefox.exe" call setpriority 32 >nul 2>&1 REM Restore graphics settings reg delete "HKCU\Software\Microsoft\DirectDraw\Renderer" /v "DefaultAdapter" /f >nul 2>&1 reg delete "HKCU\Software\Microsoft\DirectDraw\Renderer" /v "UseHardware" /f >nul 2>&1 REM Enable background services echo. echo Enabling background services... sc config "DiagTrack" start=delayed-auto >nul 2>&1 sc start "DiagTrack" >nul 2>&1 sc config "WerSvc" start=delayed-auto >nul 2>&1 sc start "WerSvc" >nul 2>&1 REM Restore Windows Update settings reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoWindowsUpdate" /f >nul 2>&1 REM Restore Windows Tips and Notifications echo. echo Restoring Windows Tips and Notifications... reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SystemPaneSuggestionsEnabled" /f >nul 2>&1 reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SubscribedContent-338389Enabled" /f >nul 2>&1 REM Restore OpenGL settings echo. echo Restoring OpenGL settings... reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\MSOpenGL" /v "DisableAsync" /f >nul 2>&1 reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\MSOpenGL" /v "EnableMultisampleBuffers" /f >nul 2>&1 reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\MSOpenGL" /v "EnableSurfaceMemoryManagement" /f >nul 2>&1 reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\MSOpenGL" /v "MaxWGLSwapInterval" /f >nul 2>&1 REM Restore GPU environment variables echo. echo Restoring GPU environment variables... setx GPU_MAX_HEAP_SIZE 50 >nul setx GPU_MAX_ALLOC_PERCENT 50 >nul setx GPU_SINGLE_ALLOC_PERCENT 50 >nul REM Restore OpenGL DLL from backup echo. echo Restoring OpenGL DLL from backup... if exist "%windir%\System32\opengl32.dll.bak" ( copy /Y "%windir%\System32\opengl32.dll.bak" "%windir%\System32\opengl32.dll" >nul 2>&1 ) else ( echo OpenGL DLL backup not found. ) REM Delete backup del "%windir%\System32\opengl32.dll.bak" >nul 2>&1 REM Finish Boost echo. color %COLOR_SUCCESS% echo Windows Boost disabled and settings restored! color 07 timeout /t 3 /nobreak >nul goto menu

    REM Function to clean disk and temporary files :clean_disk cls echo Cleaning disk and temporary files... color %COLOR_MENU% echo. REM Use built-in Disk Cleanup echo Running Disk Cleanup... cleanmgr /sagerun:1 >nul 2>&1 REM Alternatively, you can use commands to clean REM echo. REM echo Cleaning temporary files... REM del /f /s /q %TEMP%* >nul 2>&1 REM del /f /s /q C:\Windows\Temp* >nul 2>&1 REM echo Clearing prefetch data... REM del /f /s /q C:\Windows\Prefetch* >nul 2>&1 echo. color %COLOR_SUCCESS% echo Cleaning completed. color 07 timeout /t 3 /nobreak >nul goto menu

    REM Function to update system files and drivers :update_system cls echo Updating system files and drivers... color %COLOR_MENU% echo. REM Check and restore system files echo Running system file check (sfc /scannow)... sfc /scannow >nul 2>&1 echo. echo Restoring system components (DISM)... DISM /Online /Cleanup-Image /RestoreHealth >nul 2>&1 REM Update drivers via Windows Update echo. echo Updating drivers via Windows Update... powershell -Command "Install-Module PSWindowsUpdate -Force -SkipPublisherCheck" >nul 2>&1 powershell -Command "Import-Module PSWindowsUpdate" >nul 2>&1 powershell -Command "Get-WindowsUpdate -MicrosoftUpdate -AcceptAll -Install -AutoReboot" >nul 2>&1 echo. color %COLOR_SUCCESS% echo System files and drivers updated successfully. color 07 timeout /t 5 /nobreak >nul goto menu

    REM Function to create a system restore point :create_restore cls echo Creating a system restore point... color %COLOR_MENU% echo. REM Check if system restore is enabled powershell -Command "Checkpoint-Computer -Description 'Manual Restore Point' -RestorePointType 'MODIFY_SETTINGS'" >nul 2>&1 if %ERRORLEVEL% EQU 0 ( echo Restore point created successfully. ) else ( echo Failed to create restore point. Ensure that the "System Protection" service is running. ) echo. color %COLOR_SUCCESS% timeout /t 3 /nobreak >nul color 07 goto menu

    REM Function to restore default settings :restore_defaults cls echo Restoring default settings... color %COLOR_MENU% echo. REM Restore UAC and SmartScreen settings reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v "EnableLUA" /f >nul 2>&1 reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v "PromptOnSecureDesktop" /f >nul 2>&1 reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v "ConsentPromptBehaviorAdmin" /f >nul 2>&1 reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" /v SmartScreenEnabled /t REG_SZ /d "Warn" /f >nul REM Restore CPU reserve for background processes reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile" /v "SystemResponsiveness" /t REG_DWORD /d 10 /f >nul REM Restore NetworkThrottlingIndex reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile" /v "NetworkThrottlingIndex" /t REG_DWORD /d 0xFFFFFFFF /f >nul REM Enable Store app auto-updates reg delete "HKLM\SOFTWARE\Policies\Microsoft\WindowsStore" /v "AutoDownload" /f >nul 2>&1 REM Restore timeout durations reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v "AutoEndTasks" /t REG_SZ /d "0" /f >nul reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v "HungAppTimeout" /t REG_SZ /d "5000" /f >nul reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v "WaitToKillAppTimeout" /t REG_SZ /d "4000" /f >nul reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v "LowLevelHooksTimeout" /t REG_SZ /d "2000" /f >nul reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v "MenuShowDelay" /t REG_SZ /d "400" /f >nul REM Restore desktop background quality reg delete "HKEY_CURRENT_USER\Control Panel\Desktop" /v "JPEGImportQuality" /f >nul 2>&1 REM Restore system cache reg add "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Memory Management" /v "LargeSystemCache" /t REG_DWORD /d 0 /f >nul REM Restore shutdown timeout reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control" /v "WaitToKillServiceTimeout" /t REG_SZ /d "12000" /f >nul REM Enable scheduled tasks echo. echo Enabling scheduled tasks... REM Example of enabling some tasks; add others similarly schtasks /change /TN "Microsoft\Windows\Defrag\ScheduledDefrag" /enable >nul 2>&1 schtasks /change /TN "Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser" /enable >nul 2>&1 REM Restore graphics settings reg delete "HKCU\Software\Microsoft\DirectDraw\Renderer" /v "DefaultAdapter" /f >nul 2>&1 reg delete "HKCU\Software\Microsoft\DirectDraw\Renderer" /v "UseHardware" /f >nul 2>&1 REM Enable background services echo. echo Enabling background services... sc config "DiagTrack" start=delayed-auto >nul 2>&1 sc start "DiagTrack" >nul 2>&1 sc config "WerSvc" start=delayed-auto >nul 2>&1 sc start "WerSvc" >nul 2>&1 REM Restore Windows Update settings reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoWindowsUpdate" /f >nul 2>&1 REM Restore Windows Tips and Notifications echo. echo Restoring Windows Tips and Notifications... reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SystemPaneSuggestionsEnabled" /f >nul 2>&1 reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SubscribedContent-338389Enabled" /f >nul 2>&1 REM Restore OpenGL settings echo. echo Restoring OpenGL settings... reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\MSOpenGL" /v "DisableAsync" /f >nul 2>&1 reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\MSOpenGL" /v "EnableMultisampleBuffers" /f >nul 2>&1 reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\MSOpenGL" /v "EnableSurfaceMemoryManagement" /f >nul 2>&1 reg delete "HKEY_LOCAL_MACHINE\S

    WARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\MSOpenGL" /v "MaxWGLSwapInterval" /f >nul 2>&1 REM Restore GPU environment variables echo. echo Restoring GPU environment variables... setx GPU_MAX_HEAP_SIZE 50 >nul setx GPU_MAX_ALLOC_PERCENT 50 >nul setx GPU_SINGLE_ALLOC_PERCENT 50 >nul REM Restore OpenGL DLL from backup echo. echo Restoring OpenGL DLL from backup... if exist "%windir%\System32\opengl32.dll.bak" ( copy /Y "%windir%\System32\opengl32.dll.bak" "%windir%\System32\opengl32.dll" >nul 2>&1 ) else ( echo OpenGL DLL backup not found. ) REM Delete backup del "%windir%\System32\opengl32.dll.bak" >nul 2>&1 REM Finish restoration echo. color %COLOR_SUCCESS% echo Default settings restored successfully! color 07 timeout /t 3 /nobreak >nul goto menu

    REM Function to disable Cortana :disable_cortana cls echo Disabling Cortana... color %COLOR_MENU% echo. REM Disable Cortana via Registry reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v "AllowCortana" /t REG_DWORD /d 0 /f >nul REM Stop Cortana process taskkill /F /IM "SearchUI.exe" >nul 2>&1 REM Disable Cortana startup reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /v "Cortana" /t REG_SZ /d ""%windir%\SystemApps\Microsoft.Windows.Cortana_cw5n1h2txyewy\SearchUI.exe"" /f >nul echo. color %COLOR_SUCCESS% echo Cortana has been disabled successfully! color 07 timeout /t 3 /nobreak >nul goto menu

    REM Function to optimize network settings :optimize_network cls echo Optimizing network settings... color %COLOR_MENU% echo. REM Disable Windows Auto-Tuning netsh interface tcp set global autotuninglevel=disabled >nul 2>&1 REM Enable TCP Fast Open reg add "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /v "TCPFastOpen" /t REG_DWORD /d 1 /f >nul REM Disable Nagle's Algorithm reg add "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces" /v "DisableNodeNameRelease" /t REG_DWORD /d 1 /f >nul REM Optimize MTU size netsh interface ipv4 set subinterface "Ethernet" mtu=1472 store=persistent >nul 2>&1 netsh interface ipv6 set subinterface "Ethernet" mtu=1472 store=persistent >nul 2>&1 REM Flush DNS Cache ipconfig /flushdns >nul 2>&1 REM Reset TCP/IP stack netsh int ip reset >nul 2>&1 REM Disable IPv6 (если не используется) reg add "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters" /v "DisabledComponents" /t REG_DWORD /d 0xff /f >nul REM Enable Quality of Service (QoS) reg add "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /v "EnablePMTUDiscovery" /t REG_DWORD /d 1 /f >nul REM Finish Network Optimization echo. color %COLOR_SUCCESS% echo Network settings optimized successfully! color 07 timeout /t 3 /nobreak >nul goto menu

    REM Function to exit the script :exit_script cls echo Exiting the script... color %COLOR_MENU% echo. color %COLOR_SUCCESS% echo Thank you for using the Windows Optimization by Doxile! color 07 timeout /t 2 /nobreak >nul exit

    REM Function to add the script to startup :add_autostart cls echo Adding optimization to startup... color %COLOR_MENU% reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /v "WindowsOptimization" /t REG_SZ /d ""%~f0"" /f >nul if %ERRORLEVEL% EQU 0 ( color %COLOR_SUCCESS% echo Optimization successfully added to startup. ) else ( color %COLOR_ERROR% echo Failed to add optimization to startup. ) color 07 timeout /t 3 /nobreak >nul goto menu

    REM Function to display script information :what_is_script cls echo What is this script? color %COLOR_MENU% echo. echo This script gathers all optimizations and executes them in one script to improve your system's performance. echo. color 07 timeout /t 3 /nobreak >nul goto menu

  2. Assistant

    Конечно! Ниже представлен полный изменённый код вашего батч-скрипта с добавленным пунктом меню "Enable Debug / Disable Debug". При его активации все системные сообщения будут отображаться, а название кнопки будет переключаться между "Enable Debug" и "Disable Debug" в зависимости от текущего состояния.

    Изменения, которые были внесены:

    1. Добавлен пункт меню "Enable Debug / Disable Debug" (опция 9).
    2. Введена переменная DEBUG_MODE для отслеживания состояния отладки.
    3. Добавлена логика переключения режима отладки: при включении отображаются все сообщения, при выключении — только основные.
    4. Изменены команды с перенаправлением вывода >nul 2>&1 на использование переменной LOG, которая управляется состоянием отладки.

    Полный Код:

    @echo off
    setlocal EnableExtensions EnableDelayedExpansion
    
    REM Инициализация режима отладки
    set "DEBUG_MODE=0"
    set "LOG= >nul 2>&1"
    
    echo.
    REM Проверка на запуск от имени администратора
    net session >nul 2>&1
    if %errorLevel% neq 0 (
        cls
        echo This script must be run as administrator.
        pause
        exit /b
    )
    
    call :USER_DEFINED
    
    REM Set processor affinities; if not set, leave as is
    :processaffinity
    REM CREDIT TO SPDLL for the fastest code
    if defined affinity (
        if not %affinity% GTR 0 goto INVALID_AFFINITY
        PowerShell -NoLogo -NoProfile -NonInteractive -Command "Get-Process dwm,audiosvchost,audiodg,lsass,svchost,WmiPrvSE | ForEach-Object {$_.ProcessorAffinity=%affinity%}" %LOG%
    )
    :INVALID_AFFINITY
    REM Set winlogon to normal priority to prevent child processes from inheriting high priority
    wmic process where name="winlogon.exe" call setpriority 32 %LOG%
    REM Clear temporary files
    rd /s /q "%temp%" 2>nul
    mkdir "%userprofile%\AppData\Local\Temp" >nul 2>&1
    exit /b
    
    :USER_DEFINED
    wmic process where name="dwm.exe" call setpriority 32 %LOG%
    wmic process where name="lsass.exe" call setpriority 64 %LOG%
    wmic process where name="svchost.exe" call setpriority 64 %LOG%
    wmic process where name="WmiPrvSE.exe" call setpriority 64 %LOG%
    @echo off
    REM Set encoding and disable command display
    chcp 65001 >nul
    cls
    title Windows Optimization by Doxile
    REM Цветовые коды
    REM 0 = Черный 1 = Синий 2 = Зеленый
    REM 3 = Аква 4 = Красный 5 = Пурпурный
    REM 6 = Желтый 7 = Белый 8 = Серый
    REM 9 = Светло-синий 10 = Светло-зеленый и т.д.
    set "COLOR_TITLE=0A"
    set "COLOR_MENU=0E"
    set "COLOR_ERROR=0C"
    set "COLOR_SUCCESS=0A"
    set "COLOR_PROMPT=0B"
    REM Количество примененных оптимизаций
    set "optimization_count=60"  REM Увеличено количество оптимизаций
    
    REM Функция для отображения меню
    :menu
    cls
    
    REM Установка названия опции отладки
    if "%DEBUG_MODE%"=="1" (
        set "DEBUG_OPTION=Disable Debug"
    ) else (
        set "DEBUG_OPTION=Enable Debug"
    )
    
    echo  °º¤ø,¸¸,ø¤º°`°º¤ø,¸,ø¤°º¤ø,¸¸,ø¤º°`°º¤ø,¸,ø¤°º¤ø,¸¸,ø¤º°`°º¤ø,¸,ø¤°º¤ø,¸¸,ø¤º°,ø¤°º¤ø,¸¸,ø¤º°
    echo.
    echo      Windows Optimization by Doxile
    echo      Total optimizations in the script: %optimization_count%
    echo.
    echo  °º¤ø,¸¸,ø¤º°`°º¤ø,¸,ø¤°º¤ø,¸¸,ø¤º°`°º¤ø,¸,ø¤°º¤ø,¸¸,ø¤º°`°º¤ø,¸,ø¤°º¤ø,¸¸,ø¤º°,ø¤°º¤ø,¸¸,ø¤º°
    echo.
    echo        1. Apply Windows Optimizations
    echo        2. Restore Default Settings
    echo        3. Enable Windows Boost
    echo        4. Disable Windows Boost
    echo        5. Clean Disk and Temporary Files
    echo        6. Update System Files and Drivers
    echo        7. Create Restore Point
    echo        8. Optimize Network Settings
    echo        9. %DEBUG_OPTION%
    echo        0. Exit
    echo.
    echo  °º¤ø,¸¸,ø¤º°`°º¤ø,¸,ø¤°º¤ø,¸¸,ø¤º°`°º¤ø,¸,ø¤°º¤ø,¸¸,ø¤º°`°º¤ø,¸,ø¤°º¤ø,¸¸,ø¤º°,ø¤°º¤ø,¸¸,ø¤º°
    echo.
    REM Запрос выбора пользователя
    color %COLOR_PROMPT%
    set /p "choice=Enter your choice: "
    color 07
    REM Обработка выбора пользователя
    if "%choice%"=="1" goto optimizations
    if "%choice%"=="2" goto restore_defaults
    if "%choice%"=="3" goto boost_enable
    if "%choice%"=="4" goto boost_disable
    if "%choice%"=="5" goto clean_disk
    if "%choice%"=="6" goto update_system
    if "%choice%"=="7" goto create_restore
    if "%choice%"=="8" goto optimize_network
    if "%choice%"=="9" goto toggle_debug
    if "%choice%"=="0" goto exit_script
    echo.
    color %COLOR_ERROR%
    echo Invalid selection. Please try again.
    color 07
    timeout /t 2 /nobreak >nul
    goto menu
    
    REM Функция переключения режима отладки
    :toggle_debug
    if "%DEBUG_MODE%"=="0" (
        set "DEBUG_MODE=1"
        set "LOG="
        color %COLOR_PROMPT%
        echo Debug mode enabled. All system messages will be displayed.
    ) else (
        set "DEBUG_MODE=0"
        set "LOG= >nul 2>&1"
        color %COLOR_ERROR%
        echo Debug mode disabled. Only essential messages will be displayed.
    )
    color 07
    pause
    goto menu
    
    REM Optimization Function
    :optimizations
    cls
    color %COLOR_MENU%
    echo.
    echo Applying Windows optimizations...
    echo.
    REM Stop unnecessary services
    echo Stopping unnecessary services...
    net stop "SysMain" %LOG%
    net stop "Superfetch" %LOG%
    net stop "Print Spooler" %LOG%
    net stop "Fax" %LOG%
    net stop "wuauserv" %LOG%
    net stop "BITS" %LOG%
    net stop "WMPNetworkSvc" %LOG%
    net stop "ConnectedUserSharedExperiences_32771" %LOG%
    net stop "Spooler" %LOG%
    
    REM Remove programs from startup
    echo.
    echo Cleaning startup...
    reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /f %LOG%
    reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /f %LOG%
    
    REM Optimize visual effects
    echo.
    echo Optimizing visual effects...
    reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects" /v VisualFXSetting /t REG_DWORD /d 2 /f %LOG%
    reg add "HKCU\SOFTWARE\Microsoft\Windows\DWM" /v EnableTransparency /t REG_DWORD /d 0 /f %LOG%
    
    REM Disable hibernation и другие функции
    echo.
    echo Disabling hibernation and search features...
    powercfg /hibernate off %LOG%
    sc config "Windows Search" start=disabled %LOG%
    sc config "SysMain" start=disabled %LOG%
    
    REM Disable Game DVR и Delivery Optimization
    echo.
    echo Disabling Game DVR and Delivery Optimization...
    reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\GameDVR" /v AllowGameDVR /t REG_DWORD /d 0 /f %LOG%
    reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization" /v DODownloadMode /t REG_DWORD /d 0 /f %LOG%
    reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization" /v DOUploadMode /t REG_DWORD /d 0 /f %LOG%
    
    REM Disable background tasks
    echo.
    echo Disabling scheduled tasks...
    for %%a in (
        "Microsoft\Windows\Defrag\ScheduledDefrag"
        "Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser"
        "Microsoft\Windows\Application Experience\ProgramDataUpdater"
        "Microsoft\Windows\Application Experience\StartupAppTask"
        "Microsoft\Windows\Device Information\Device"
        "Microsoft\Windows\Diagnosis\Scheduled"
        "Microsoft\Windows\Diagnosis\RecommendedTroubleshootingScanner"
        "Microsoft\Windows\DiskFootprint\Diagnostics"
        "Microsoft\Windows\DiskFootprint\StorageSense"
        "Microsoft\Windows\Feedback\Siuf\DmClientOnScenarioDownload"
        "Microsoft\Windows\Feedback\Siuf\DmClient"
        "Microsoft\Windows\International\Synchronize Language Settings"
        "Microsoft\Windows\LanguageComponentsInstaller\Installation"
        "Microsoft\Windows\LanguageComponentsInstaller\ReconcileLanguageResources"
        "Microsoft\Windows\Maps\MapsUpdateTask"
        "Microsoft\Windows\Maps\MapsToastTask"
        "Microsoft\Windows\PushToInstall\Registration"
        "Microsoft\Windows\Setup\SetupCleanupTask"
        "Microsoft\Windows\Speech\SpeechModelDownloadTask"
        "Microsoft\Windows\Windows Error Reporting\QueueReporting"
        "Microsoft\Windows\WindowsColorSystem\Calibration Loader"
        "Microsoft\Windows\Work Folders\Work Folders Logon Synchronization"
        "Microsoft\Windows\MemoryDiagnostic\ProcessMemoryDiagnosticEvents"
        "Microsoft\Windows\MemoryDiagnostic\RunFullMemoryDiagnostic"
    ) do schtasks /change /tn "%%a" /disable %LOG%
    
    REM Optimize power and performance settings
    echo.
    echo Optimizing power and performance settings...
    powercfg /setactive 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c %LOG%
    reg add "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\PriorityControl" /v "Win32PrioritySeparation" /t REG_DWORD /d 38 /f %LOG%
    
    REM Set process priorities
    echo.
    echo Setting process priorities...
    for %%P in ("BstkSVC.exe" "HD-Agent.exe" "HD-Player.exe" "BlueStacks.exe") do (
        reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\%%~P\PerfOptions" /v "CpuPriorityClass" /t REG_DWORD /d 3 /f %LOG%
    )
    
    REM Optimize multimedia profiles
    echo.
    echo Optimizing multimedia profiles...
    reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Games" /v "GPU Priority" /t REG_DWORD /d 8 /f %LOG%
    reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Games" /v "Priority" /t REG_DWORD /d 6 /f %LOG%
    reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Games" /v "Scheduling Category" /t REG_SZ /d "High" /f %LOG%
    reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Games" /v "SFIO Priority" /t REG_SZ /d "High" /f %LOG%
    reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\PowerThrottling" /v "PowerThrottlingOff" /t REG_DWORD /d 1 /f %LOG%
    reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile" /v "SystemResponsiveness" /t REG_DWORD /d 0 /f %LOG%
    reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile" /v "NetworkThrottlingIndex" /t REG_DWORD /d 0xffffffff /f %LOG%
    
    REM Configure USB settings for performance
    echo.
    echo Configuring USB settings...
    for /f "tokens=2 delims==" %%a in ('WMIC PATH Win32_USBHub GET DeviceID /VALUE ^| find "="') do (
        for %%b in ("EnhancedPowerManagementEnabled" "AllowIdleIrpInD3" "SelectiveSuspendOn" "DeviceSelectiveSuspended" "SelectiveSuspendEnabled") do (
            reg add "HKLM\SYSTEM\CurrentControlSet\Enum\%%a\Device Parameters" /v "%%~b" /t REG_DWORD /d 0 /f %LOG%
        )
    )
    
    REM Disable Game Bar and game settings
    echo.
    echo Disabling Game Bar and game settings...
    reg add "HKCU\SOFTWARE\Microsoft\GameBar" /v "ShowStartupPanel" /t REG_DWORD /d 0 /f %LOG%
    reg add "HKCU\SOFTWARE\Microsoft\GameBar" /v "GamePanelStartupTipIndex" /t REG_DWORD /d 3 /f %LOG%
    reg add "HKCU\SOFTWARE\Microsoft\GameBar" /v "AllowAutoGameMode" /t REG_DWORD /d 0 /f %LOG%
    reg add "HKCU\SOFTWARE\Microsoft\GameBar" /v "AutoGameModeEnabled" /t REG_DWORD /d 0 /f %LOG%
    reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\GameDVR" /v "AllowGameDVR" /t REG_DWORD /d 0 /f %LOG%
    reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR" /v "AppCaptureEnabled" /t REG_DWORD /d 0 /f %LOG%
    
    REM Additional optimizations
    echo.
    echo Applying additional optimizations...
    REM Disable search indexing
    reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" /v "GatherSystemTags" /t REG_DWORD /d 0 /f %LOG%
    reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" /v "GatherExtendedProperties" /t REG_DWORD /d 0 /f %LOG%
    reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" /v "IndexingPaused" /t REG_DWORD /d 1 /f %LOG%
    
    REM Disable notifications
    reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\PushNotifications" /v "ToastEnabled" /t REG_DWORD /d 0 /f %LOG%
    reg add "HKCU\Software\Policies\Microsoft\Windows\Explorer" /v "DisableNotificationCenter" /t REG_DWORD /d 1 /f %LOG%
    
    REM Disable Windows advertising elements
    reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SystemPaneSuggestionsEnabled" /t REG_DWORD /d 0 /f %LOG%
    reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SubscribedContent-338388Enabled" /t REG_DWORD /d 0 /f %LOG%
    reg add "HKCU\Software\Microsoft\Windows\ContentDeliveryManager" /v "SubscribedContent-338389Enabled" /t REG_DWORD /d 0 /f %LOG%
    
    REM Disable telemetry
    reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\DataCollection" /v "AllowTelemetry" /t REG_DWORD /d 0 /f %LOG%
    
    REM Disable background applications
    reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications" /v "GlobalUserDisabled" /t REG_DWORD /d 1 /f %LOG%
    
    REM Disable automatic driver updates
    reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\DriverSearching" /v "SearchOrderConfig" /t REG_DWORD /d 0 /f %LOG%
    
    REM Disable automatic Windows updates
    reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v "NoAutoUpdate" /t REG_DWORD /d 1 /f %LOG%
    
    REM Configure virtual memory settings
    echo.
    echo Configuring virtual memory settings...
    reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v "PagingFiles" /t REG_MULTI_SZ /d "C:\pagefile.sys 4096 8192" /f %LOG%
    
    REM Optimize registry for faster startup
    reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Serialize" /v "StartupDelayInMSec" /t REG_DWORD /d 0 /f %LOG%
    
    REM Clean prefetch and temporary files
    echo.
    REM Additional optimizations (additional steps)
    echo.
    echo Applying additional optimizations (additional steps)...
    
    REM Step 1: Disable UAC и SmartScreen
    reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v "EnableLUA" /t REG_DWORD /d 0 /f %LOG%
    reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v "PromptOnSecureDesktop" /t REG_DWORD /d 0 /f %LOG%
    reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v "ConsentPromptBehaviorAdmin" /t REG_DWORD /d 0 /f %LOG%
    reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" /v SmartScreenEnabled /t REG_SZ /d "Off" /f %LOG%
    
    REM Step 2: Disable CPU reserve for background processes
    reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile" /v "SystemResponsiveness" /t REG_DWORD /d 0a /f %LOG%
    
    REM Step 3: Configure NetworkThrottlingIndex
    reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile" /v "NetworkThrottlingIndex" /t REG_DWORD /d 0a /f %LOG%
    
    REM Step 4: Disable Store app auto-updates
    reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore" /v "AutoDownload" /t REG_DWORD /d 2 /f %LOG%
    
    REM Step 5: Reduce timeout durations
    reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v "AutoEndTasks" /t REG_SZ /d "1" /f %LOG%
    reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v "HungAppTimeout" /t REG_SZ /d "1000" /f %LOG%
    reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v "WaitToKillAppTimeout" /t REG_SZ /d "2000" /f %LOG%
    reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v "LowLevelHooksTimeout" /t REG_SZ /d "1000" /f %LOG%
    reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v "MenuShowDelay" /t REG_SZ /d "0" /f %LOG%
    
    REM Step 6: Set desktop background quality
    reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v "JPEGImportQuality" /t REG_DWORD /d 80 /f %LOG%
    
    REM Step 7: Increase system cache
    reg add "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Memory Management" /v "LargeSystemCache" /t REG_DWORD /d 1 /f %LOG%
    
    REM Step 8: Reduce shutdown timeout
    reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control" /v "WaitToKillServiceTimeout" /t REG_SZ /d "10000" /f %LOG%
    
    REM Step 9: Disable additional scheduled tasks
    call :disable_additional_tasks
    
    REM Step 10: Disable unnecessary devices using DevManView
    call :disable_devices
    
    REM Step 11: Disable more scheduled tasks
    call :disable_more_tasks
    
    REM Step 12: Configure OpenGL
    call :configure_opengl
    
    REM Step 13: Additional OpenGL settings
    call :additional_opengl_settings
    
    REM Step 14: Set GPU environment variables
    call :set_gpu_env
    
    REM Step 15: Protect OpenGL DLL
    call :protect_opengl
    
    REM Step 16: Disable Remote Registry Service
    echo.
    echo Disabling Remote Registry Service...
    sc config "RemoteRegistry" start=disabled %LOG%
    sc stop "RemoteRegistry" %LOG%
    
    REM Step 17: Disable Windows Tips
    echo.
    echo Disabling Windows Tips...
    reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SubscribedContent-338389Enabled" /t REG_DWORD /d 0 /f %LOG%
    reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SubscribedContent-338384Enabled" /t REG_DWORD /d 0 /f %LOG%
    reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SubscribedContent-338387Enabled" /t REG_DWORD /d 0 /f %LOG%
    
    REM Step 18: Disable Transparency Effects
    echo.
    echo Disabling Transparency Effects...
    reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize" /v "EnableTransparency" /t REG_DWORD /d 0 /f %LOG%
    
    REM Step 19: Disable Animations
    echo.
    echo Disabling Window Animations...
    reg add "HKCU\Control Panel\Desktop" /v "WindowAnimation" /t REG_SZ /d "0" /f %LOG%
    reg add "HKCU\Control Panel\Desktop" /v "MinAnimate" /t REG_SZ /d "0" /f %LOG%
    
    REM Step 20: Disable Shake Window Effect
    echo.
    echo Disabling Shake Window Effect...
    reg add "HKCU\Control Panel\Desktop" /v "ClientVisualStylePrefe" /t REG_SZ /d "0" /f %LOG%
    reg add "HKCU\Control Panel\Desktop" /v "WindowArrangementActive" /t REG_SZ /d "0" /f %LOG%
    
    REM Finish optimizations
    echo.
    color %COLOR_SUCCESS%
    echo Optimizations successfully applied!
    color 07
    timeout /t 3 /nobreak >nul
    goto menu
    
    REM Function to disable additional tasks (Step 9)
    :disable_additional_tasks
    echo.
    echo Disabling additional scheduled tasks (Step 9)...
    REM Insert user step 9 commands here
    for %%T in (
        "Microsoft\Windows\.NET Framework\.NET Framework NGEN v4.0.30319"
        "Microsoft\Windows\.NET Framework\.NET Framework NGEN v4.0.30319 64"
        "Microsoft\Windows\.NET Framework\.NET Framework NGEN v4.0.30319 64 Critical"
        "Microsoft\Windows\.NET Framework\.NET Framework NGEN v4.0.30319 Critical"
        "Microsoft\Windows\ApplicationData\appuriverifierdaily"
        "Microsoft\Windows\ApplicationData\appuriverifierinstall"
        "Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser"
        "Microsoft\Windows\Application Experience\ProgramDataUpdater"
        "Microsoft\Windows\Application Experience\StartupAppTask"
        "Microsoft\Windows\Device Information\Device"
        "Microsoft\Windows\Diagnosis\Scheduled"
        "Microsoft\Windows\Diagnosis\RecommendedTroubleshootingScanner"
        "Microsoft\Windows\DiskFootprint\Diagnostics"
        "Microsoft\Windows\DiskFootprint\StorageSense"
        "Microsoft\Windows\Feedback\Siuf\DmClientOnScenarioDownload"
        "Microsoft\Windows\Feedback\Siuf\DmClient"
        "Microsoft\Windows\International\Synchronize Language Settings"
        "Microsoft\Windows\LanguageComponentsInstaller\Installation"
        "Microsoft\Windows\LanguageComponentsInstaller\ReconcileLanguageResources"
        "Microsoft\Windows\Maps\MapsUpdateTask"
        "Microsoft\Windows\Maps\MapsToastTask"
        "Microsoft\Windows\PushToInstall\Registration"
        "Microsoft\Windows\Setup\SetupCleanupTask"
        "Microsoft\Windows\Speech\SpeechModelDownloadTask"
        "Microsoft\Windows\Windows Error Reporting\QueueReporting"
        "Microsoft\Windows\WindowsColorSystem\Calibration Loader"
        "Microsoft\Windows\Work Folders\Work Folders Logon Synchronization"
    ) do schtasks /change /TN "%%~T" /DISABLE %LOG%
    echo Additional tasks disabled successfully!
    goto :eof
    
    REM Function to disable devices using DevManView (Step 10)
    :disable_devices
    echo.
    echo Disabling unnecessary devices (Step 10)...
    REM Ensure DevManView.exe is in the same directory as the script
    if not exist "%cd%\devmanview\devmanview.exe" (
        echo DevManView.exe not found. Skipping device disabling.
        goto :eof
    )
    for %%D in (
        "UMBus Root Bus Enumerator"
        "Root Print Queue"
        "NDIS Virtual Network Adapter Enumerator"
        "Microsoft Virtual Drive Enumerator"
        "Microsoft Hyper-V Virtualization Infrastructure Driver"
        "Microsoft GS Wavetable Synth"
        "Microsoft Device Association Root Enumerator"
        "Composite Bus Enumerator"
        "Microsoft UEFI-Compliant System"
        "System board"
        "SM Bus Controller"
        "Motherboard resources"
        "PCI Encryption/Decryption Controller"
        "Microsoft Windows Management Interface for ACPI"
        "High precision event timer"
        "Base System Device"
        "PCI Data Acquisition and Signal Processing Controller"
        "PCI Simple Communications Controller"
        "PCI Device"
        "Unknown Device"
        "PCI Memory Controller"
        "PCI standard RAM Controller"
        "ACPI Processor Aggregator"
        "ACPI Wake Alarm"
        "System Speaker"
        "System Timer"
        "WAN Miniport (IKEv2)"
        "WAN Miniport (IP)"
        "WAN Miniport (IPv6)"
        "WAN Miniport (L2TP)"
        "WAN Miniport (Network Monitor)"
        "WAN Miniport (PPPOE)"
        "WAN Miniport (PPTP)"
        "WAN Miniport (SSTP)"
        "Programmable Interrupt Controller"
        "Numeric Data Processor"
        "Microsoft Kernel Debug Network Adapter"
        "HID-compliant consumer control device"
        "Plug and Play Software Device Enumerator"
        "Direct memory access controller"
    ) do (
        "%cd%\devmanview\devmanview.exe" /disable "%%~D" %LOG%
    )
    echo Devices disabled successfully!
    goto :eof
    
    REM Function to disable more scheduled tasks (Step 11)
    :disable_more_tasks
    echo.
    echo Disabling additional scheduled tasks (Step 11)...
    REM Insert step 11 commands here
    for %%F in (
        "\MicrosoftEdgeUpdateTaskMachineCore"
        "\MicrosoftEdgeUpdateTaskMachineUA"
        "\Microsoft\Windows\Power Efficiency Diagnostics\AnalyzeSystem"
        "\Microsoft\Windows\Windows Error Reporting\QueueReporting"
        "\Microsoft\Windows\DiskFootprint\Diagnostics"
        "\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser"
        "\Microsoft\Windows\Application Experience\StartupAppTask"
        "\Microsoft\Windows\Autochk\Proxy"
        "\Microsoft\Windows\Application Experience\PcaPatchDbTask"
        "\Microsoft\Windows\BrokerInfrastructure\BgTaskRegistrationMaintenanceTask"
        "\Microsoft\Windows\CloudExperienceHost\CreateObjectTask"
        "\Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticDataCollector"
        "\Microsoft\Windows\Defrag\ScheduledDefrag"
        "\Microsoft\Windows\DiskFootprint\StorageSense"
        "\MicrosoftEdgeUpdateBrowserReplacementTask"
        "\Microsoft\Windows\Registry\RegIdleBackup"
        "\Microsoft\Windows\Windows Filtering Platform\BfeOnServiceStartTypeChange"
        "\Microsoft\Windows\Shell\IndexerAutomaticMaintenance"
        "\Microsoft\Windows\SoftwareProtectionPlatform\SvcRestartTaskNetwork"
        "\Microsoft\Windows\SoftwareProtectionPlatform\SvcRestartTaskLogon"
        "\Microsoft\Windows\StateRepository\MaintenanceTasks"
        "\Microsoft\Windows\UpdateOrchestrator\Report policies"
        "\Microsoft\Windows\UpdateOrchestrator\Schedule Scan Static Task"
        "\Microsoft\Windows\UpdateOrchestrator\UpdateModelTask"
        "\Microsoft\Windows\UpdateOrchestrator\USO_UxBroker"
        "\Microsoft\Windows\UpdateOrchestrator\Schedule Work"
        "\Microsoft\Windows\UPnP\UPnPHostConfig"
        "\Microsoft\Windows\RetailDemo\CleanupOfflineContent"
        "\Microsoft\Windows\Shell\FamilySafetyMonitor"
        "\Microsoft\Windows\InstallService\ScanForUpdates"
        "\Microsoft\Windows\InstallService\ScanForUpdatesAsUser"
        "\Microsoft\Windows\InstallService\SmartRetry"
        "\Microsoft\Windows\International\Synchronize Language Settings"
        "\Microsoft\Windows\MemoryDiagnostic\ProcessMemoryDiagnosticEvents"
        "\Microsoft\Windows\MemoryDiagnostic\RunFullMemoryDiagnostic"
        "\Microsoft\Windows\Multimedia\Microsoft\Windows\Multimedia"
        "\Microsoft\Windows\Printing\EduPrintProv"
        "\Microsoft\Windows\RemoteAssistance\RemoteAssistanceTask"
        "\Microsoft\Windows\Ras\MobilityManager"
        "\Microsoft\Windows\PushToInstall\LoginCheck"
        "\Microsoft\Windows\Time Synchronization\SynchronizeTime"
        "\Microsoft\Windows\Time Synchronization\ForceSynchronizeTime"
        "\Microsoft\Windows\Time Zone\SynchronizeTimeZone"
        "\Microsoft\Windows\UpdateOrchestrator\Schedule Scan"
        "\Microsoft\Windows\WaaSMedic\PerformRemediation"
        "\Microsoft\Windows\DiskCleanup\SilentCleanup"
        "\Microsoft\Windows\Diagnosis\Scheduled"
        "\Microsoft\Windows\Wininet\CacheTask"
        "\Microsoft\Windows\Device Setup\Metadata Refresh"
        "\Microsoft\Windows\Mobile Broadband Accounts\MNO Metadata Parser"
        "\Microsoft\Windows\WindowsUpdate\Scheduled Start"
    ) do schtasks /change /TN "%%~F" /disable %LOG%
    echo.
    goto :eof
    
    REM Function to configure OpenGL (Step 12)
    :configure_opengl
    echo.
    echo Configuring OpenGL (Step 12)...
    REM Example OpenGL configuration adjusted for Batch
    set "OPENGL_32=%windir%\system32\opengl32.dll"
    set "OPENGL_DEBUG=1"
    echo OPENGL_32="%OPENGL_32%"
    echo OPENGL_DEBUG="%OPENGL_DEBUG%"
    REM Add additional commands here if necessary
    goto :eof
    
    REM Function for additional OpenGL settings (Step 13)
    :additional_opengl_settings
    echo.
    echo Applying additional OpenGL settings (Step 13)...
    reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\MSOpenGL" /v "DisableAsync" /t REG_DWORD /d 1 /f %LOG%
    reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\MSOpenGL" /v "EnableMultisampleBuffers" /t REG_DWORD /d 1 /f %LOG%
    reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\MSOpenGL" /v "EnableSurfaceMemoryManagement" /t REG_DWORD /d 1 /f %LOG%
    reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\MSOpenGL" /v "MaxWGLSwapInterval" /t REG_DWORD /d 1 /f %LOG%
    goto :eof
    
    REM Function to set GPU environment variables (Step 14)
    :set_gpu_env
    echo.
    echo Setting GPU environment variables (Step 14)...
    setx GPU_MAX_HEAP_SIZE 100 >nul
    setx GPU_MAX_ALLOC_PERCENT 100 >nul
    setx GPU_SINGLE_ALLOC_PERCENT 100 >nul
    goto :eof
    
    REM Function to protect OpenGL DLL (Step 15)
    :protect_opengl
    echo.
    echo Protecting OpenGL DLL (Step 15)...
    set "OPENGL_32_DLL=%windir%\System32\opengl32.dll"
    set "OPENGL_32_DLL_SIZE=2576980377"
    if exist "%OPENGL_32_DLL%.bak" (
        echo Backup already exists.
    ) else (
        copy "%OPENGL_32_DLL%" "%OPENGL_32_DLL%.bak" %LOG%
        fsutil file setvaliddata "%OPENGL_32_DLL%" %OPENGL_32_DLL_SIZE% %LOG%
    )
    goto :eof
    
    REM Function to enable Windows Boost
    :boost_enable
    cls
    echo Enabling Windows Boost...
    color %COLOR_MENU%
    echo.
    REM Apply high-performance mode
    powercfg -setactive SCHEME_MIN %LOG%
    REM Terminate explorer.exe process
    taskkill /f /im explorer.exe %LOG%
    REM Additional Boost optimizations
    echo.
    echo Applying additional Boost settings...
    REM Increase process priorities
    wmic process where name="chrome.exe" call setpriority 128 %LOG%
    wmic process where name="firefox.exe" call setpriority 128 %LOG%
    REM Disable visual effects for speed
    reg add "HKCU\Control Panel\Desktop" /v "WindowAnimation" /t REG_SZ /d "0" /f %LOG%
    reg add "HKCU\Control Panel\Desktop" /v "MinAnimate" /t REG_SZ /d "0" /f %LOG%
    REM Enable maximum graphics performance (for systems with discrete graphics)
    echo.
    echo Configuring graphics settings for maximum performance...
    reg add "HKCU\Software\Microsoft\DirectDraw\Renderer" /v "DefaultAdapter" /t REG_DWORD /d 0 /f %LOG%
    reg add "HKCU\Software\Microsoft\DirectDraw\Renderer" /v "UseHardware" /t REG_DWORD /d 1 /f %LOG%
    REM Disable background services
    echo.
    echo Disabling background services...
    sc stop "DiagTrack" %LOG%
    sc config "DiagTrack" start=disabled %LOG%
    sc stop "WerSvc" %LOG%
    sc config "WerSvc" start=disabled %LOG%
    REM Disable unnecessary Windows features
    reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoWindowsUpdate" /t REG_DWORD /d 1 /f %LOG%
    REM Disable Windows Tips and Notifications
    echo.
    echo Disabling Windows Tips and Notifications...
    reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SystemPaneSuggestionsEnabled" /t REG_DWORD /d 0 /f %LOG%
    reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SubscribedContent-338389Enabled" /t REG_DWORD /d 0 /f %LOG%
    REM Finish Boost
    echo.
    color %COLOR_SUCCESS%
    echo Windows Boost enabled and optimizations applied!
    color 07
    timeout /t 3 /nobreak >nul
    goto menu
    
    REM Function to disable Windows Boost
    :boost_disable
    cls
    echo Disabling Windows Boost...
    color %COLOR_MENU%
    echo.
    REM Return to balanced power plan
    powercfg -setactive SCHEME_BALANCED %LOG%
    REM Start explorer.exe process
    start explorer.exe >nul 2>&1
    REM Restore visual effects
    echo.
    echo Restoring visual settings...
    reg add "HKCU\Control Panel\Desktop" /v "WindowAnimation" /t REG_SZ /d "1" /f %LOG%
    reg add "HKCU\Control Panel\Desktop" /v "MinAnimate" /t REG_SZ /d "1" /f %LOG%
    REM Restore process priorities
    wmic process where name="chrome.exe" call setpriority 32 %LOG%
    wmic process where name="firefox.exe" call setpriority 32 %LOG%
    REM Restore graphics settings
    reg delete "HKCU\Software\Microsoft\DirectDraw\Renderer" /v "DefaultAdapter" /f %LOG%
    reg delete "HKCU\Software\Microsoft\DirectDraw\Renderer" /v "UseHardware" /f %LOG%
    REM Enable background services
    echo.
    echo Enabling background services...
    sc config "DiagTrack" start=delayed-auto %LOG%
    sc start "DiagTrack" %LOG%
    sc config "WerSvc" start=delayed-auto %LOG%
    sc start "WerSvc" %LOG%
    REM Restore Windows Update settings
    reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoWindowsUpdate" /f %LOG%
    REM Restore Windows Tips and Notifications
    echo.
    echo Restoring Windows Tips and Notifications...
    reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SystemPaneSuggestionsEnabled" /f %LOG%
    reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SubscribedContent-338389Enabled" /f %LOG%
    REM Restore OpenGL settings
    echo.
    echo Restoring OpenGL settings...
    reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\MSOpenGL" /v "DisableAsync" /f %LOG%
    reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\MSOpenGL" /v "EnableMultisampleBuffers" /f %LOG%
    reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\MSOpenGL" /v "EnableSurfaceMemoryManagement" /f %LOG%
    reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\MSOpenGL" /v "MaxWGLSwapInterval" /f %LOG%
    
    REM Restore GPU environment variables
    echo.
    echo Restoring GPU environment variables...
    setx GPU_MAX_HEAP_SIZE 50 >nul
    setx GPU_MAX_ALLOC_PERCENT 50 >nul
    setx GPU_SINGLE_ALLOC_PERCENT 50 >nul
    
    REM Restore OpenGL DLL from backup
    echo.
    echo Restoring OpenGL DLL from backup...
    if exist "%windir%\System32\opengl32.dll.bak" (
        copy /Y "%windir%\System32\opengl32.dll.bak" "%windir%\System32\opengl32.dll" %LOG%
    ) else (
        echo OpenGL DLL backup not found.
    )
    
    REM Delete backup
    del "%windir%\System32\opengl32.dll.bak" >nul 2>&1
    
    REM Finish Boost
    echo.
    color %COLOR_SUCCESS%
    echo Windows Boost disabled and settings restored!
    color 07
    timeout /t 3 /nobreak >nul
    goto menu
    
    REM Function to clean disk and temporary files
    :clean_disk
    cls
    echo Cleaning disk and temporary files...
    color %COLOR_MENU%
    echo.
    REM Use built-in Disk Cleanup
    echo Running Disk Cleanup...
    cleanmgr /sagerun:1 %LOG%
    REM Alternatively, you can use commands to clean
    REM echo.
    REM echo Cleaning temporary files...
    REM del /f /s /q %TEMP%\* >nul 2>&1
    REM del /f /s /q C:\Windows\Temp\* >nul 2>&1
    REM echo Clearing prefetch data...
    REM del /f /s /q C:\Windows\Prefetch\* >nul 2>&1
    echo.
    color %COLOR_SUCCESS%
    echo Cleaning completed.
    color 07
    timeout /t 3 /nobreak >nul
    goto menu
    
    REM Function to update system files and drivers
    :update_system
    cls
    echo Updating system files and drivers...
    color %COLOR_MENU%
    echo.
    REM Check and restore system files
    echo Running system file check (sfc /scannow)...
    sfc /scannow %LOG%
    echo.
    echo Restoring system components (DISM)...
    DISM /Online /Cleanup-Image /RestoreHealth %LOG%
    REM Update drivers via Windows Update
    echo.
    echo Updating drivers via Windows Update...
    powershell -Command "Install-Module PSWindowsUpdate -Force -SkipPublisherCheck" %LOG%
    powershell -Command "Import-Module PSWindowsUpdate" %LOG%
    powershell -Command "Get-WindowsUpdate -MicrosoftUpdate -AcceptAll -Install -AutoReboot" %LOG%
    echo.
    color %COLOR_SUCCESS%
    echo System files and drivers updated successfully.
    color 07
    timeout /t 5 /nobreak >nul
    goto menu
    
    REM Function to create a system restore point
    :create_restore
    cls
    echo Creating a system restore point...
    color %COLOR_MENU%
    echo.
    REM Check if system restore is enabled
    powershell -Command "Checkpoint-Computer -Description 'Manual Restore Point' -RestorePointType 'MODIFY_SETTINGS'" %LOG%
    if %ERRORLEVEL% EQU 0 (
        echo Restore point created successfully.
    ) else (
        echo Failed to create restore point. Ensure that the "System Protection" service is running.
    )
    echo.
    color %COLOR_SUCCESS%
    timeout /t 3 /nobreak >nul
    color 07
    goto menu
    
    REM Function to restore default settings
    :restore_defaults
    cls
    echo Restoring default settings...
    color %COLOR_MENU%
    echo.
    REM Restore UAC и SmartScreen settings
    reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v "EnableLUA" /f %LOG%
    reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v "PromptOnSecureDesktop" /f %LOG%
    reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v "ConsentPromptBehaviorAdmin" /f %LOG%
    reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" /v SmartScreenEnabled /t REG_SZ /d "Warn" /f %LOG%
    
    REM Restore CPU reserve for background processes
    reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile" /v "SystemResponsiveness" /t REG_DWORD /d 10 /f %LOG%
    
    REM Restore NetworkThrottlingIndex
    reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile" /v "NetworkThrottlingIndex" /t REG_DWORD /d 0xFFFFFFFF /f %LOG%
    
    REM Enable Store app auto-updates
    reg delete "HKLM\SOFTWARE\Policies\Microsoft\WindowsStore" /v "AutoDownload" /f %LOG%
    
    REM Restore timeout durations
    reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v "AutoEndTasks" /t REG_SZ /d "0" /f %LOG%
    reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v "HungAppTimeout" /t REG_SZ /d "5000" /f %LOG%
    reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v "WaitToKillAppTimeout" /t REG_SZ /d "4000" /f %LOG%
    reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v "LowLevelHooksTimeout" /t REG_SZ /d "2000" /f %LOG%
    reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v "MenuShowDelay" /t REG_SZ /d "400" /f %LOG%
    
    REM Restore desktop background quality
    reg delete "HKEY_CURRENT_USER\Control Panel\Desktop" /v "JPEGImportQuality" /f %LOG%
    
    REM Restore system cache
    reg add "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Memory Management" /v "LargeSystemCache" /t REG_DWORD /d 0 /f %LOG%
    
    REM Restore shutdown timeout
    reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control" /v "WaitToKillServiceTimeout" /t REG_SZ /d "12000" /f %LOG%
    
    REM Enable scheduled tasks
    echo.
    echo Enabling scheduled tasks...
    for %%S in (
        "Microsoft\Windows\Defrag\ScheduledDefrag"
        "Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser"
    ) do schtasks /change /TN "%%~S" /enable %LOG%
    
    REM Restore graphics settings
    reg delete "HKCU\Software\Microsoft\DirectDraw\Renderer" /v "DefaultAdapter" /f %LOG%
    reg delete "HKCU\Software\Microsoft\DirectDraw\Renderer" /v "UseHardware" /f %LOG%
    
    REM Enable background services
    echo.
    echo Enabling background services...
    sc config "DiagTrack" start=delayed-auto %LOG%
    sc start "DiagTrack" %LOG%
    sc config "WerSvc" start=delayed-auto %LOG%
    sc start "WerSvc" %LOG%
    
    REM Restore Windows Update settings
    reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoWindowsUpdate" /f %LOG%
    
    REM Restore Windows Tips and Notifications
    echo.
    echo Restoring Windows Tips and Notifications...
    reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SystemPaneSuggestionsEnabled" /f %LOG%
    reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SubscribedContent-338389Enabled" /f %LOG%
    
    REM Restore OpenGL settings
    echo.
    echo Restoring OpenGL settings...
    reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\MSOpenGL" /v "DisableAsync" /f %LOG%
    reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\MSOpenGL" /v "EnableMultisampleBuffers" /f %LOG%
    reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\MSOpenGL" /v "EnableSurfaceMemoryManagement" /f %LOG%
    reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\MSOpenGL" /v "MaxWGLSwapInterval" /f %LOG%
    
    REM Restore GPU environment variables
    echo.
    echo Restoring GPU environment variables...
    setx GPU_MAX_HEAP_SIZE 50 >nul
    setx GPU_MAX_ALLOC_PERCENT 50 >nul
    setx GPU_SINGLE_ALLOC_PERCENT 50 >nul
    
    REM Restore OpenGL DLL from backup
    echo.
    echo Restoring OpenGL DLL from backup...
    if exist "%windir%\System32\opengl32.dll.bak" (
        copy /Y "%windir%\System32\opengl32.dll.bak" "%windir%\System32\opengl32.dll" %LOG%
    ) else (
        echo OpenGL DLL backup not found.
    )
    
    REM Delete backup
    del "%windir%\System32\opengl32.dll.bak" >nul 2>&1
    
    REM Finish restoration
    echo.
    color %COLOR_SUCCESS%
    echo Default settings restored successfully!
    color 07
    timeout /t 3 /nobreak >nul
    goto menu
    
    REM Function to disable Cortana
    :disable_cortana
    cls
    echo Disabling Cortana...
    color %COLOR_MENU%
    echo.
    REM Disable Cortana via Registry
    reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v "AllowCortana" /t REG_DWORD /d 0 /f %LOG%
    REM Stop Cortana process
    taskkill /F /IM "SearchUI.exe" %LOG%
    REM Disable Cortana startup
    reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /v "Cortana" /t REG_SZ /d "\"%windir%\SystemApps\Microsoft.Windows.Cortana_cw5n1h2txyewy\SearchUI.exe\"" /f %LOG%
    echo.
    color %COLOR_SUCCESS%
    echo Cortana has been disabled successfully!
    color 07
    timeout /t 3 /nobreak >nul
    goto menu
    
    REM Function to optimize network settings
    :optimize_network
    cls
    echo Optimizing network settings...
    color %COLOR_MENU%
    echo.
    REM Disable Windows Auto-Tuning
    netsh interface tcp set global autotuninglevel=disabled %LOG%
    REM Enable TCP Fast Open
    reg add "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /v "TCPFastOpen" /t REG_DWORD /d 1 /f %LOG%
    REM Disable Nagle's Algorithm
    reg add "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces" /v "DisableNodeNameRelease" /t REG_DWORD /d 1 /f %LOG%
    REM Optimize MTU size
    netsh interface ipv4 set subinterface "Ethernet" mtu=1472 store=persistent %LOG%
    netsh interface ipv6 set subinterface "Ethernet" mtu=1472 store=persistent %LOG%
    REM Flush DNS Cache
    ipconfig /flushdns %LOG%
    REM Reset TCP/IP stack
    netsh int ip reset %LOG%
    REM Disable IPv6 (если не используется)
    reg add "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters" /v "DisabledComponents" /t REG_DWORD /d 0xff /f %LOG%
    REM Enable Quality of Service (QoS)
    reg add "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /v "EnablePMTUDiscovery" /t REG_DWORD /d 1 /f %LOG%
    REM Finish Network Optimization
    echo.
    color %COLOR_SUCCESS%
    echo Network settings optimized successfully!
    color 07
    timeout /t 3 /nobreak >nul
    goto menu
    
    REM Function to exit the script
    :exit_script
    cls
    echo Exiting the script...
    color %COLOR_MENU%
    echo.
    color %COLOR_SUCCESS%
    echo Thank you for using the Windows Optimization by Doxile!
    color 07
    timeout /t 2 /nobreak >nul
    exit
    
    REM Function to add the script to startup
    :add_autostart
    cls
    echo Adding optimization to startup...
    color %COLOR_MENU%
    reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /v "WindowsOptimization" /t REG_SZ /d "\"%~f0\"" /f %LOG%
    if %ERRORLEVEL% EQU 0 (
        color %COLOR_SUCCESS%
        echo Optimization successfully added to startup.
    ) else (
        color %COLOR_ERROR%
        echo Failed to add optimization to startup.
    )
    color 07
    timeout /t 3 /nobreak >nul
    goto menu
    
    REM Function to display script information
    :what_is_script
    cls
    echo What is this script?
    color %COLOR_MENU%
    echo.
    echo This script gathers all optimizations and executes them in one script to improve your system's performance.
    echo.
    color 07
    timeout /t 3 /nobreak >nul
    goto menu
    

    Основные моменты:

    1. Переменная DEBUG_MODE: Отслеживает состояние отладки. 0 — отладка выключена, 1 — включена.
    2. Переменная LOG: Используется для управления перенаправлением вывода команд. При DEBUG_MODE=0 вывод скрывается (>nul 2>&1), при DEBUG_MODE=1 вывод отображается.
    3. Пункт меню "Enable Debug / Disable Debug": Добавлен пункт 9 в меню для переключения режима отладки. В зависимости от текущего состояния, текст пункта будет изменяться.
    4. Переключение режима отладки: При выборе пункта 9 происходит переключение состояния отладки и настройка переменной LOG соответственно.
    5. Изменение команд: Все команды, которые ранее имели перенаправление вывода, теперь используют переменную %LOG%, что позволяет контролировать отображение сообщений на основе состояния отладки.

    Примечания:

    • DevManView: Убедитесь, что файл DevManView.exe находится в папке devmanview рядом с вашим скриптом. Если его нет, то отключение устройств будет пропущено с соответствующим сообщением.
    • Права администратора: Скрипт должен запускаться с правами администратора для корректной работы.
    • Резервное копирование: Некоторые функции, такие как защита DLL, создают резервные копии. Убедитесь, что у вас достаточно прав и места для выполнения этих действий.
    • Безопасность: Будьте осторожны при выполнении оптимизаций и отключении системных сервисов. Некоторые из них могут быть необходимы для стабильной работы Windows.

    Использование:

    1. Запуск скрипта: Запустите скрипт от имени администратора.
    2. Выбор опции отладки: Выберите пункт 9 в меню, чтобы включить или отключить режим отладки.
    3. Применение оптимизаций: Выбирайте другие пункты меню для выполнения соответствующих действий.

    Этот модифицированный скрипт позволит вам управлять уровнем отображаемой информации, делая процесс оптимизации более прозрачным или более скрытым в зависимости от ваших предпочтений.