PowerShell来关闭 Windows 安全中心

你可以使用 PowerShell 来关闭 Windows 安全中心的盾牌图标(通知)。以下是几种方法,包括禁用通知、关闭 Windows Defender(不推荐)或调整注册表。


方法 1:禁用 Windows 安全中心通知(推荐)

这个脚本会禁用 Windows 安全中心的通知,从而隐藏盾牌图标,但不会完全关闭安全功能。

powershell 复制代码
# 禁用 Windows 安全中心通知
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Name "HideSCAHealth" -Value 1 -Force
Stop-Process -Name explorer -Force  # 重启资源管理器使更改生效

恢复方法(重新启用通知):

powershell 复制代码
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Name "HideSCAHealth" -Force
Stop-Process -Name explorer -Force

方法 2:临时禁用 Windows Defender(不推荐)

⚠️ 注意:这会降低系统安全性,建议仅在必要时使用,并安装其他杀毒软件替代。

powershell 复制代码
# 临时禁用 Windows Defender 实时保护(重启后会恢复)
Set-MpPreference -DisableRealtimeMonitoring $true

恢复方法

powershell 复制代码
Set-MpPreference -DisableRealtimeMonitoring $false

方法 3:彻底禁用 Windows Defender(通过注册表)

powershell 复制代码
# 禁用 Windows Defender(需管理员权限)
New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender" -Name "DisableAntiSpyware" -Value 1 -PropertyType DWORD -Force
Restart-Computer  # 需要重启生效

恢复方法

powershell 复制代码
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender" -Name "DisableAntiSpyware" -Force
Restart-Computer

方法 4:隐藏任务栏盾牌图标

如果只是不想看到盾牌图标,可以隐藏它:

powershell 复制代码
# 隐藏 Windows 安全中心任务栏图标
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer" -Name "EnableAutoTray" -Value 1 -Force
Stop-Process -Name explorer -Force

恢复方法

powershell 复制代码
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer" -Name "EnableAutoTray" -Value 0 -Force
Stop-Process -Name explorer -Force

总结

方法 效果 是否影响安全
禁用通知 (HideSCAHealth) 隐藏盾牌,但 Defender 仍在运行 ❌ 不影响
临时禁用 Defender 关闭实时保护,但重启后恢复 ⚠️ 临时降低安全
彻底禁用 Defender 完全关闭 Defender ❗ 大幅降低安全
隐藏任务栏图标 仅隐藏图标,不影响功能 ❌ 不影响

推荐使用 方法 1(禁用通知),因为它不会影响系统安全性。

如果你只是想隐藏盾牌,而不是完全关闭安全功能,建议使用 方法 1方法 4

希望这能帮到你!如果有问题,欢迎继续交流。 😊