@echo off chcp 65001 mode con lines=40 title Optimizer - Win 10 - 2021-05-18 cls echo. echo 性能优化 echo - 禁用 Windows 自带垃圾服务 echo - 禁用一些软件的垃圾服务 echo - 禁用页面文件 echo - 禁用应用程序预读 echo - 减少应用程序响应超时 echo - 自动卸载 DLL echo - 删除垃圾开机启动项 echo - 禁用 Windows 更新的 7GB 保留空间 echo. echo 安全性 echo - 允许设置自动登录 echo - 允许使用 HTTP 连接 WebDAV 站点 echo - 禁用 IPSec 以允许使用预共享密钥的 L2TP 连接 echo - 禁用 CD-ROM 自动运行 echo. echo 个性化 echo - 使用 pool.ntp.org 作为 NTP 客户端同步的地址 echo - 禁用关机原因 echo - 禁用登录前的 CTRL + ALT + DELETE echo - 禁用休眠 echo - 桌面壁纸使用最高质量 echo - 禁用快捷方式后缀 echo - 删除资源管理器中的 3D 对象 echo - 禁用 thumbs.db 文件 echo. rem ================================================================================ rem 检查管理员身份 rem check UAC set uac="%temp%\uac.vbs" >nul 2>&1 "%windir%\system32\cacls.exe" "%windir%\system32\config\system" if '%errorlevel%' NEQ '0' ( goto uac ) else ( if exist %uac% del %uac% rem echo 按任意键开始执行优化。 rem pause > nul goto run ) :uac echo. echo 修改系统设置需要管理员身份。 echo Set UAC = CreateObject^("Shell.Application"^) > %uac% echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> %uac% %uac% exit /b :run echo. rem ================================================================================ rem 性能优化 rem 禁用 Windows 自带垃圾服务 rem Service: Application Layer Gateway Service sc config alg start= disabled >nul rem echo Service: AVCTP rem sc config bthavctpsvc start= disabled >nul rem Service: Computer Browser sc config browser start= auto >nul rem Service: Certificate Propagation sc config certpropsvc start= disabled >nul rem Service: Connected User Experiences and Telemetry sc config diagtrack start= disabled >nul rem Service: Debugging Helper sc config debugregsvc start= disabled >nul rem Service: Diagnostic Execution Service sc config diagsvc start= disabled >nul rem Service: Diagnostic Policy Service sc config dps start= disabled >nul rem Service: Diagnostic Service Host sc config wdiservicehost start= disabled >nul rem Service: Diagnostic System Host sc config wdisystemhost start= disabled >nul rem Service: Distributed Transaction Coordinator sc config msdtc start= disabled >nul rem Service: Encrypting File System sc config efs start= disabled >nul rem Service: Geolocation Service sc config lfsvc start= disabled >nul rem Service: HomeGroup Listener sc config homegrouplistener start= disabled >nul rem Service: HomeGroup Provider sc config homegroupprovider start= disabled >nul rem Service: Internet Connection Sharing (ICS) sc config sharedaccess start= disabled >nul rem Service: Offline Files sc config cscservice start= disabled >nul rem Service: Portable Device Enumerator Service sc config wpdbusenum start= disabled >nul rem Service: Problem Reports and Solutions Control Panel Support sc config wercplsupport start= disabled >nul rem Service: Program Compatibility Assistant Service sc config pcasvc start= disabled >nul rem Service: Quality Windows Audio Video Experience sc config qwave start= disabled >nul rem Service: SSDP Discovery sc config ssdpsrv start= disabled >nul rem Service: Superfetch sc config sysmain start= disabled >nul rem Service: Themes sc config themes start= disabled >nul rem Service: Windows Error Reporting Service sc config wersvc start= disabled >nul rem Service: Windows Search sc config wsearch start= disabled >nul rem Service: WMI Performance Adapter sc config wmiApSrv start= disabled >nul rem 禁用 Adobe 垃圾服务 sc config agsservice start= disabled >nul sc config adobeupdateservice start= disabled >nul rem 禁用 iTunes 垃圾服务 sc config ipxlatcfgsvc start= disabled >nul rem 禁用 Intel 垃圾服务 sc config cplspcon start= disabled >nul sc config cphs start= disabled >nul sc config esifsvc start= disabled >nul sc config igfxcuiservice1.0.0.0 start= disabled >nul sc config igfxcuiservice2.0.0.0 start= disabled >nul sc config jhi_service start= disabled >nul sc config "Intel(R) Capability Licensing Service TCP IP Interface" start= disabled >nul sc config "Intel(R) TPM Provisioning Service" start= disabled >nul rem 禁用 NVIDIA 垃圾服务 sc config nvcontainerlocalsystem start= disabled >nul sc config nvcontainernetworkservice start= disabled >nul sc config nvdisplay.containerlocalsystem start= disabled >nul sc config nvtelemetrycontainer start= disabled >nul rem 禁用 AMD 垃圾服务 sc config "AMD External Events Utility" start= disabled >nul regsvr32 /u /s atiacmxx.dll >nul rem set vk="hkcr\directory\background\shellex\ace" rem reg delete %vk% /f >nul rem 禁用 VMware 垃圾服务 sc config tpautoconnsvc start= disabled >nul sc config vmvss start= disabled >nul sc config vgauthservice start= disabled >nul sc config "vmware physical disk helper service" start= disabled >nul rem 禁用页面文件 set vk="hklm\system\currentcontrolset\control\session manager\memory management" reg add %vk% /v "pagingfiles" /t reg_multi_sz /d "" /f >nul reg add %vk% /v "disablepagingexecutive" /t reg_dword /d 1 /f >nul rem reg add %vk% /v "clearpagefileatshutdown" /t reg_dword /d 1 /f >nul rem 禁用应用程序预读 set vk="hklm\system\currentcontrolset\control\session manager\memory management\prefetchparameters" reg add %vk% /v "enableprefetcher" /t reg_dword /d 1 /f >nul reg add %vk% /v "enablesuprefetcher" /t reg_dword /d 3 /f >nul rem 减少应用程序响应超时 set vk="hklm\system\currentcontrolset\control\windows" reg add %vk% /v "nopopupsonboot" /t reg_dword /d 1 /f >nul set vk="hklm\system\currentcontrolset\control" reg add %vk% /v "waittokillservicetimeout" /t reg_sz /d "1000" /f >nul set vk="hkcu\control panel\desktop" reg add %vk% /v "autoendtasks" /t reg_sz /d "1" /f >nul reg add %vk% /v "hungapptimeout" /t reg_sz /d "500" /f >nul reg add %vk% /v "waittokillapptimeout" /t reg_sz /d "1000" /f >nul set vk="hku\.default\control panel\desktop" reg add %vk% /v "autoendtasks" /t reg_sz /d "1" /f >nul reg add %vk% /v "hungapptimeout" /t reg_sz /d "500" /f >nul reg add %vk% /v "waittokillapptimeout" /t reg_sz /d "1000" /f >nul rem 自动卸载 DLL set vk="hklm\software\microsoft\windows\currentversion\explorer" reg add %vk% /v "alwaysunloaddll" /t reg_dword /d 1 /f >nul rem 删除垃圾开机启动项 set vk="hklm\software\microsoft\windows\currentversion\run" reg delete %vk% /v "hotkeyscmds" /f >nul reg delete %vk% /v "igfxtray" /f >nul reg delete %vk% /v "persistence" /f >nul reg delete %vk% /v "rthdcpl" /f >nul reg delete %vk% /v "adobeaamupdater-1.0" /f >nul reg delete %vk% /v "windowsdefender" /f >nul set vk="hklm\software\wow6432node\microsoft\windows\currentversion\run" reg delete %vk% /v "vmware-tray.exe" /f >nul reg delete %vk% /v "adskappmanager" /f >nul reg delete %vk% /v "adobe arm" /f >nul rem 禁用 Windows 更新的 7GB 保留空间 set vk="hklm\software\microsoft\windows\currentversion\reservemanager" reg add %vk% /v "shippedwithreserves" /t reg_dword /d 0 /f >nul rem 启用 TSX(性能提升极小可忽略不计) rem set vk="HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Kernel" rem reg add %vk% /v "DisableTsx" /t reg_dword /d 0 /f >nul rem ================================================================================ rem 安全性 rem 允许设置自动登录 set vk="hklm\Software\Microsoft\Windows NT\CurrentVersion\PasswordLess\Device" reg add %vk% /v "DevicePasswordLessBuildVersion" /t reg_dword /d 0 /f >nul rem 允许使用 HTTP 连接 WebDAV 站点 set vk="HKLM\SYSTEM\CurrentControlSet\Services\WebClient\Parameters" reg add %vk% /v "BasicAuthLevel" /t REG_DWORD /d 2 /f >nul reg add %vk% /v "FileSizeLimitInBytes" /t REG_DWORD /d 4294967295 /f >nul sc config WebClient start= demand >nul sc stop WebClient >nul sc start WebClient >nul rem 禁用 IPSec 以允许使用预共享密钥的 L2TP 连接 set vk="hklm\system\currentcontrolset\services\rasman\parameters" reg add %vk% /v "ProhibitIPSec" /t reg_dword /d 0 /f >nul set vk="hklm\system\currentcontrolset\services\policyagent" reg add %vk% /v "AssumeUDPEncapsulationContextOnSendRule" /t reg_dword /d 2 /f >nul rem 禁用 CD-ROM 自动运行 set vk="hklm\system\currentcontrolset\services\cdrom" reg add %vk% /v "autorun" /t reg_dword /d 0 /f >nul rem ================================================================================ rem 个性化 rem 使用 pool.ntp.org 作为 NTP 客户端同步的地址 echo Service: Windows Time set vk="HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Config" reg add %vk% /v "AnnounceFlags" /t reg_dword /d 5 /f >nul set vk="HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpServer" reg add %vk% /v "Enabled" /t reg_dword /d 1 /f >nul set vk="HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient" reg add %vk% /v "SpecialPollInterval" /t reg_dword /d 60 /f >nul set vk="HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters" reg add %vk% /v "NtpServer" /t reg_sz /d "pool.ntp.org" /f >nul sc config w32time start= auto >nul sc stop w32time >nul sc start w32time >nul rem 禁用关机原因 echo Personalized: Easily Operation set vk="hklm\software\policies\microsoft\windows nt\reliability" reg add %vk% /v "shutdownreasonon" /t reg_dword /d 1 /f >nul rem 禁用登录前的 CTRL + ALT + DELETE set vk="hklm\software\microsoft\windows\currentversion\policies\system" reg add %vk% /v "disablecad" /t reg_dword /d 1 /f >nul rem 禁用休眠 powercfg -h off >nul rem 启用卓越性能 rem powercfg -duplicatescheme e9a42b02-d5df-448d-aa00-03f14749eb61 rem 禁用锁频后自动熄屏 rem set vk="HKLM\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\7516b95f-f776-4464-8c53-06167f40cc99\8EC4B3A5-6868-48c2-BE75-4F3044BE88A7" rem reg add %vk% /v "Attributes" /t reg_dword /d 2 /f >nul rem 桌面壁纸使用最高质量 set vk="hkcu\control panel\desktop" reg add %vk% /v "jpegimportquality" /t reg_dword /d 100 /f >nul set vk="hku\.default\control panel\desktop" reg add %vk% /v "jpegimportquality" /t reg_dword /d 100 /f >nul rem 禁用快捷方式后缀 set vk="hkcu\software\microsoft\windows\currentversion\explorer" reg add %vk% /v "link" /t reg_dword /d 0 /f >nul set vk="hku\.default\software\microsoft\windows\currentversion\explorer" reg add %vk% /v "link" /t reg_dword /d 0 /f >nul rem 删除资源管理器中的 3D 对象 set vk="hklm\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}" reg delete %vk% /f >nul rem 禁用 thumbs.db 文件 set vk="HKLM\SOFTWARE\Policies\Microsoft\Windows\Explorer" reg add %vk% /v "DisableThumbsDBOnNetworkFolders" /t reg_dword /d 1 /f >nul rem 启用数字键区 rem set vk="hku\.default\control pannel\keyboard" rem reg add %vk% /v "InitialKeyboardIndicators" /t reg_sz /d "80000002" /f >nul rem ================================================================================ echo. echo The optimizing operation had been completed. echo 优化已完成,部分优化项在重启后生效。 :end