Skip to content

Instantly share code, notes, and snippets.

@eplord
Created October 30, 2024 08:02
Show Gist options
  • Save eplord/621d71bd4fd083b345df73ac58691fe5 to your computer and use it in GitHub Desktop.
Save eplord/621d71bd4fd083b345df73ac58691fe5 to your computer and use it in GitHub Desktop.
disable defender windows 11
:: How to Permanently Disable Windows Defender Antivirus in Windows 11
@Echo Off & Cls
net sess>nul 2>&1||(powershell start cmd -ArgumentList """/c %~0""" -verb Runas & exit)
:_Start
Cls & Mode CON LINES=11 COLS=60 & Color 0E &Title Created By FreeBooter
Echo.
Echo.
Echo Type (D) letter to Disable Windows Defender
Echo.
Echo.
Echo.
Echo.
Echo Type (E) letter to Enable Windows Defender
Echo.
Set /p input=^>
If /i Not %input%==D (Goto :_Ex) Else (Goto :_Disable)
:_Ex
If /i Not %input%==E (Goto :_Start) Else (Goto :_Enable)
:_Disable
PowerShell Checkpoint-Computer -Description "Enable Windows Defender" -RestorePointType "MODIFY_SETTINGS"
Reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender" /v "DisableAntiSpyware" /t REG_DWORD /d "1" /f
Reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender" /v "DisableRealtimeMonitoring" /t REG_DWORD /d "1" /f
Reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender" /v "DisableAntiVirus" /t REG_DWORD /d "1" /f
Reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender" /v "DisableSpecialRunningModes" /t REG_DWORD /d "1" /f
Reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender" /v "DisableRoutinelyTakingAction" /t REG_DWORD /d "1" /f
Reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender" /v "ServiceKeepAlive" /t REG_DWORD /d "0" /f
Reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender" /v "ServiceStartStates" /t REG_DWORD /d "1" /f
Reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection" /v "DisableBehaviorMonitoring" /t REG_DWORD /d "1" /f
Reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection" /v "DisableOnAccessProtection" /t REG_DWORD /d "1" /f
Reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection" /v "DisableScanOnRealtimeEnable" /t REG_DWORD /d "1" /f
Reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection" /v "DisableRealtimeMonitoring" /t REG_DWORD /d "1" /f
Reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\Signature Updates" /v "ForceUpdateFromMU" /t REG_DWORD /d "0" /f
Reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet" /v "DisableBlockAtFirstSeen" /t REG_DWORD /d "1" /f
Cls & Mode CON LINES=5 COLS=48 & Color 04 & Title - WARNING -
Echo.
Echo.
Echo Windows Defender Disabled
Ping -n 5 localhost > Nul
Goto :Reboot
:_Enable
Reg.exe delete "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender" /v "DisableAntiSpyware" /f
Reg.exe delete "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender" /v "DisableRealtimeMonitoring" /f
Reg.exe delete "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender" /v "DisableAntiVirus" /f
Reg.exe delete "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender" /v "DisableSpecialRunningModes" /f
Reg.exe delete "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender" /v "DisableRoutinelyTakingAction" /f
Reg.exe delete "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender" /v "ServiceKeepAlive" /f
Reg.exe delete "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender" /v "ServiceStartStates" /f
Reg.exe delete "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection" /f
Reg.exe delete "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\Signature Updates" /f
Reg.exe delete "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet" /f
Cls & Mode CON LINES=5 COLS=48 & Color E0 & Title - WARNING -
Echo.
Echo.
Echo Windows Defender Enabled
Ping -n 5 localhost > Nul
:Reboot
Cls & Mode CON LINES=11 COLS=42 & Color 0E & Title FreeBooter
Echo.
Echo.
Echo THIS COMPUTER WILL REBOOT
Echo.
Echo.
Echo PLEASE SAVE ALL WORK IN PROGRESS
Echo.
Echo.
Echo PRESS 'ENTER' KEY TO RESTART COMPUTER
Pause >Nul
Shutdown -r -t 5 -c "REBOOTING SYSTEM" 2>&1 > Nul
Exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment