@echo off
chcp 65001 >nul
echo ==============================================
echo 正在禁用Windows Defender、自动更新及安全功能...
echo 警告:此操作会大幅降低系统安全性!
echo ==============================================
pause
:: 1. 关闭UAC(可选,如需保留可注释)
reg add "HKLMSOFTWAREMicrosoftWindowsCurrentVersionPoliciesSystem" /v EnableLUA /t REG_DWORD /d 0 /f >nul
:: 2. 删除EPP右键菜单扩展
reg delete "HKLMSOFTWAREClasses*shellexContextMenuHandlersEPP" /f >nul 2>&1
reg delete "HKLMSOFTWAREClassesDirectoryshellexContextMenuHandlersEPP" /f >nul 2>&1
reg delete "HKLMSOFTWAREClassesDriveshellexContextMenuHandlersEPP" /f >nul 2>&1
:: 3. 禁用Windows Defender核心功能
reg add "HKLMSOFTWAREPoliciesMicrosoftWindows Defender" /v DisableAntiSpyware /t REG_DWORD /d 1 /f >nul
reg add "HKLMSOFTWAREPoliciesMicrosoftWindows Defender" /v DisableAntiVirus /t REG_DWORD /d 1 /f >nul
:: 4. 禁用Defender实时防护
reg add "HKLMSOFTWAREPoliciesMicrosoftWindows DefenderReal-Time Protection" /v DisableBehaviorMonitoring /t REG_DWORD /d 1 /f >nul
reg add "HKLMSOFTWAREPoliciesMicrosoftWindows DefenderReal-Time Protection" /v DisableIOAVProtection /t REG_DWORD /d 1 /f >nul
reg add "HKLMSOFTWAREPoliciesMicrosoftWindows DefenderReal-Time Protection" /v DisableOnAccessProtection /t REG_DWORD /d 1 /f >nul
reg add "HKLMSOFTWAREPoliciesMicrosoftWindows DefenderReal-Time Protection" /v DisableRealtimeMonitoring /t REG_DWORD /d 1 /f >nul
reg add "HKLMSOFTWAREPoliciesMicrosoftWindows DefenderReal-Time Protection" /v DisableScanOnRealtimeEnable /t REG_DWORD /d 1 /f >nul
:: 5. 禁用Defender通知和托盘
reg add "HKLMSOFTWAREPoliciesMicrosoftWindows Defender Security CenterNotifications" /v DisableNotifications /t REG_DWORD /d 1 /f >nul
reg add "HKLMSOFTWAREPoliciesMicrosoftWindows Defender Security CenterSystray" /v HideSystray /t REG_DWORD /d 1 /f >nul
:: 6. 禁用SmartScreen
reg add "HKLMSOFTWAREMicrosoftWindowsCurrentVersionExplorer" /v SmartScreenEnabled /t REG_SZ /d Off /f >nul
reg add "HKLMSOFTWAREPoliciesMicrosoftWindowsSystem" /v EnableSmartScreen /t REG_DWORD /d 0 /f >nul
:: 7. 禁用Windows自动更新
reg add "HKLMSOFTWAREPoliciesMicrosoftWindowsWindowsUpdateAU" /v AUOptions /t REG_DWORD /d 1 /f >nul
reg add "HKLMSOFTWAREPoliciesMicrosoftWindowsWindowsUpdateAU" /v NoAutoUpdate /t REG_DWORD /d 1 /f >nul
reg add "HKLMSOFTWAREPoliciesMicrosoftWindowsWindowsUpdateAU" /v UseWUServer /t REG_DWORD /d 1 /f >nul
reg add "HKLMSOFTWAREPoliciesMicrosoftWindowsWindowsUpdate" /v WUServer /t REG_SZ /d [url]http://127.0.0.1[/url] /f >nul
reg add "HKLMSOFTWAREPoliciesMicrosoftWindowsWindowsUpdate" /v WUStatusServer /t REG_SZ /d [url]http://127.0.0.1[/url] /f >nul
:: 8. 隐藏更新/Defender设置页
reg add "HKLMSOFTWAREMicrosoftWindowsCurrentVersionPoliciesExplorer" /v SettingsPageVisibility /t REG_SZ /d "Hide:windowsupdate;windowsupdate-action;windowsdefender" /f >nul
:: 9. 禁用安全相关服务
sc config BITS start= disabled >nul
sc config DoSvc start= disabled >nul
sc config SecurityHealthService start= disabled >nul
sc config Sense start= disabled >nul
sc config UsoSvc start= disabled >nul
sc config WaaSMedicSvc start= disabled >nul
sc config wscsvc start= disabled >nul
:: 10. 停止已运行的安全服务
net stop BITS /y >nul 2>&1
net stop DoSvc /y >nul 2>&1
net stop SecurityHealthService /y >nul 2>&1
net stop Sense /y >nul 2>&1
net stop UsoSvc /y >nul 2>&1
net stop WaaSMedicSvc /y >nul 2>&1
net stop wscsvc /y >nul 2>&1
echo.
echo 禁用操作完成!建议仅在测试环境使用,按任意键退出...
pause >nul
exit
|