The following code (which I did NOT compose) was highly useful in disabling Windows Defender for me. I got it from one of Freebooter's videos:
Code:
:: 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 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
After doing this, I went to Windows\System32\smartscreen.exe and renamed it smartscreen.exe.old since it is part of WIndows Defender and would still run even after all of the above had been performed.
Now I just have my Antivirus of my choice running without having Windows Defender running in the background.
bob