Мне нужно, чтоб в конце оптимизации мне не пришлось нажимать на любую клавишу чтоб оказаться в меню. (НУ И ВООБЩЕ СО ВСЕМИ ПУНКТАМИ, МНЕ НУЖНО ЧТОБ НЕ НАДО БЫЛО НАЖИМАТЬ НА ЛЮБУЮ КЛАВИШУ ЧТОБ ОТКРЫТЬ МЕНЮ, МНЕ НУЖНО ЧТОБ МЕНЮ ОТКРЫВАЛОСЬ САМО) Также добавь еще больше оптимизаций для компа.

@echo off
echo.
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 10 Optimization Tool
REM Color codes
REM 0 = Black 1 = Blue 2 = Green
REM 3 = Aqua 4 = Red 5 = Purple
REM 6 = Yellow 7 = White 8 = Gray
REM 9 = Light Blue 10 = Light Green, etc.
set "COLOR_TITLE=0A"
set "COLOR_MENU=0E"
set "COLOR_ERROR=0C"
set "COLOR_SUCCESS=0A"
set "COLOR_PROMPT=0B"
REM Number of optimizations applied
set "optimization_count=55"  REM Increased for new optimizations
REM Function to display menu
:menu
cls
echo.
echo ╔════════════════════════════════════════════════════════════════════════╗
echo ║ Windows Optimization by Doxile                                         ║
echo ╠════════════════════════════════════════════════════════════════════════╣
echo ║ Total optimizations in the script: %optimization_count%                  ║
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 ║ [0] Exit                                                                ║
echo ╚════════════════════════════════════════════════════════════════════════╝
echo.
REM Prompt user for choice
color %COLOR_PROMPT%
set /p choice="Select a menu option [1-0]: "
color 07
REM Handle user choice
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%"=="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.
echo Cleaning temporary files and prefetch data...
del /f /s /q C:\Windows\Prefetch\* >nul 2>&1
del /f /s /q %TEMP%\* >nul 2>&1
del /f /s /q C:\Windows\Temp\* >nul 2>&1
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 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 Simple Communications Controller" >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" >nul 2>&1
schtasks /Change /Disable /TN "\Microsoft\Windows\BrokerInfrastructure\BgTaskRegistrationMaintenanceTask" >nul 2>&1
schtasks /Change /Disable /TN "\Microsoft\Windows\CloudExperienceHost\CreateObjectTask" >nul 2>&1
schtasks /Change /Disable /TN "\Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticDataCollector" >nul 2>&1
schtasks /Change /Disable /TN "\Microsoft\Windows\Defrag\ScheduledDefrag" >nul 2>&1
schtasks /Change /Disable /TN "\Microsoft\Windows\DiskFootprint\StorageSense" >nul 2>&1
schtasks /Change /Disable /TN "\MicrosoftEdgeUpdateBrowserReplacementTask" >nul 2>&1
schtasks /Change /Disable /TN "\Microsoft\Windows\Registry\RegIdleBackup" >nul 2>&1
schtasks /Change /Disable /TN "\Microsoft\Windows\Windows Filtering Platform\BfeOnServiceStartTypeChange" >nul 2>&1
schtasks /Change /Disable /TN "\Microsoft\Windows\Shell\IndexerAutomaticMaintenance" >nul 2>&1
schtasks /Change /Disable /TN "\Microsoft\Windows\SoftwareProtectionPlatform\SvcRestartTaskNetwork" >nul 2>&1
schtasks /Change /Disable /TN "\Microsoft\Windows\SoftwareProtectionPlatform\SvcRestartTaskLogon" >nul 2>&1
schtasks /Change /Disable /TN "\Microsoft\Windows\StateRepository\MaintenanceTasks" >nul 2>&1
schtasks /Change /Disable /TN "\Microsoft\Windows\UpdateOrchestrator\Report policies" >nul 2>&1
schtasks /Change /Disable /TN "\Microsoft\Windows\UpdateOrchestrator\Schedule Scan Static Task" >nul 2>&1
schtasks /Change /Disable /TN "\Microsoft\Windows\UpdateOrchestrator\UpdateModelTask" >nul 2>&1
schtasks /Change /Disable /TN "\Microsoft\Windows\UpdateOrchestrator\USO_UxBroker" >nul 2>&1
schtasks /Change /Disable /TN "\Microsoft\Windows\UpdateOrchestrator\Schedule Work" >nul 2>&1
schtasks /Change /Disable /TN "\Microsoft\Windows\UPnP\UPnPHostConfig" >nul 2>&1
schtasks /Change /Disable /TN "\Microsoft\Windows\RetailDemo\CleanupOfflineContent" >nul 2>&1
schtasks /Change /Disable /TN "\Microsoft\Windows\Shell\FamilySafetyMonitor" >nul 2>&1
schtasks /Change /Disable /TN "\Microsoft\Windows\InstallService\ScanForUpdates" >nul 2>&1
schtasks /Change /Disable /TN "\Microsoft\Windows\InstallService\ScanForUpdatesAsUser" >nul 2>&1
schtasks /Change /Disable /TN "\Microsoft\Windows\InstallService\SmartRetry" >nul 2>&1
schtasks /Change /Disable /TN "\Microsoft\Windows\International\Synchronize Language Settings" >nul 2>&1
schtasks /Change /Disable /TN "\Microsoft\Windows\MemoryDiagnostic\ProcessMemoryDiagnosticEvents" >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" >nul 2>&1
schtasks /Change /Disable /TN "\Microsoft\Windows\PushToInstall\LoginCheck" >nul 2>&1
schtasks /Change /Disable /TN "\Microsoft\Windows\Time Synchronization\SynchronizeTime" >nul 2>&1
schtasks /Change /Disable /TN "\Microsoft\Windows\Time Synchronization\ForceSynchronizeTime" >nul 2>&1
schtasks /Change /Disable /TN "\Microsoft\Windows\Time Zone\SynchronizeTimeZone" >nul 2>&1
schtasks /Change /Disable /TN "\Microsoft\Windows\UpdateOrchestrator\Schedule Scan" >nul 2>&1
schtasks /Change /Disable /TN "\Microsoft\Windows\WaaSMedic\PerformRemediation" >nul 2>&1
schtasks /Change /Disable /TN "\Microsoft\Windows\DiskCleanup\SilentCleanup" >nul 2>&1
schtasks /Change /Disable /TN "\Microsoft\Windows\Diagnosis\Scheduled" >nul 2>&1
schtasks /Change /Disable /TN "\Microsoft\Windows\Wininet\CacheTask" >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" >nul 2>&1
echo.
pause >nul
goto menu

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 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 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 "HKEY_LOCAL_MACHINE\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 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 restoration
echo.
color %COLOR_SUCCESS%
echo Default settings restored 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 10 Optimization Tool!
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
pause >nul
goto menu

НАПИШИ ФУЛЛ КОД КОТОРЫЙ В ИТОГЕ ПОУЛЧИЛСЯ