Skip to content

Instantly share code, notes, and snippets.

@ccy
Created January 20, 2024 01:52
Show Gist options
  • Save ccy/ec452285362d9b65aa23814fcfc3294f to your computer and use it in GitHub Desktop.
Save ccy/ec452285362d9b65aa23814fcfc3294f to your computer and use it in GitHub Desktop.
Disable Windows Defender
# Disable Windows defender tasks in Normal mode
Get-ScheduledTask | Where-Object { $_.TaskName -like "Windows Defender*" } | Disable-ScheduledTask
# Reboot to safe mode (Boot option: Safe mode)
msconfig
# Disable these services in safe mode
foreach ($SVC in "Sense", "WdBoot", "WdFilter", "WdNisDrv", "WdNisSvc", "WinDefend") { Set-ItemProperty -Path ("HKLM:\SYSTEM\CurrentControlSet\Services\" + $SVC) -Name Start -Value 4 }
# Reboot to normal mode (Startup Selection: Normal startup)
msconfig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment