Реши пожалуйста проблему, вот когда я захожу в скрипт, то вместо ║
╚════════════════════════════════════════════════════════════════════════╝, у меня просто какие-то символы: XPtXPtXPt
@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 Optimization by Doxile
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=60" REM Увеличено количество оптимизаций
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 ║ [8] Optimize Network Settings ║
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%"=="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 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 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
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
не пиши фулл код, просто дай решение
Проблема с отображением символов, таких как ║ и ╝, вместо корректных символов, скорее всего, связана с несоответствием кодовой страницы консоли и кодировки файла скрипта. Вот несколько шагов, которые помогут решить эту проблему:
Поменяйте кодовую страницу:
Вместо использования chcp 65001 (UTF-8), которая может не полностью поддерживать символы рисования в командной строке Windows, попробуйте установить кодовую страницу, подходящую для русского языка и поддерживающую нужные символы. Например, кодовая страница 866 (DOS Russian) может лучше подойти.
Замените строку:
chcp 65001 >nul
на:
chcp 866 >nul
Проверьте кодировку файла скрипта:
Убедитесь, что ваш .bat файл сохранен в кодировке ANSI или Windows-1251, соответствующей установленной кодовой странице (866). Сохранение файла в UTF-8 может вызвать проблемы с отображением символов в командной строке.
В Notepad++:
Откройте скрипт.
Перейдите в меню Кодировка.
Выберите Кодировка ANSI или Cyrillic (Windows-1251).
Сохраните файл.
В стандартном Блокноте:
Откройте скрипт.
Выберите Файл > Сохранить как....
Внизу в поле Кодировка выберите ANSI.
Сохраните файл.
Убедитесь, что шрифт консоли поддерживает символы рисования:
Используйте шрифт, поддерживающий символы рисования, например Consolas или Lucida Console.
Как изменить шрифт консоли:
Откройте командную строку.
Щелкните правой кнопкой мыши на заголовке окна и выберите Свойства.
Перейдите на вкладку Шрифт.
Выберите Consolas или другой подходящий шрифт.
Нажмите ОК.
Пример изменения кодовой страницы в скрипте:
Вот как можно модифицировать ваш скрипт для использования кодовой страницы 866:
@echo off
echo.
call :USER_DEFINED
REM Установить кодовую страницу 866 для русского языка
chcp 866 >nul
cls
title Windows Optimization by Doxile
REM Остальной код...
Альтернативное решение — использовать простые символы:
Если изменения кодовой страницы и кодировки файла не решают проблему, рассмотрите возможность заменить символы рисования на простые символы ASCII, такие как |, -, +, чтобы обеспечить корректное отображение независимо от настроек системы.
Например:
echo +------------------------------------------------------------+
echo | Windows Optimization by Doxile |
echo +------------------------------------------------------------+
Эти шаги должны помочь вам корректно отображать символы в вашем скрипте. Если после выполнения всех шагов проблема сохраняется, убедитесь, что ваша система поддерживает выбранную кодировку и шрифт, а также что скрипт сохранен правильно без дополнительных символов или BOM (Byte Order Mark).