Disabling Windows Defender Anti-Virus Permanently
Sometimes when deploying a Windows computer, you may want to disable Windows Defender Firewall. If you are installing a professional anti-virus software, there is no reason to have two anti-virus agents inspecting each file. This only slows your computer down. To disable the free Windows Defender anti-virus, follow these steps.
Open Command Prompt as Administrator, and paste the following code.
START /MIN /WAIT powershell -command "Add-MpPreference -ExclusionPath "%USERPROFILE%\Documents\'Smart IT Firm Agent'""
START /MIN /WAIT powershell -command "Set-MpPreference -DisableRealtimeMonitoring $true" && START /WAIT netsh advfirewall set allprofiles state off && reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender" /f /v "DisableAntiSpyware" /t REG_DWORD /d 1 && reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender" /f /v "DisableAntiSpyware" /t REG_DWORD /d 1 && reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender" /f /v "DisableRealtimeMonitoring" /t REG_DWORD /d 1 && reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection" /f /v "DisableBehaviorMonitoring" /t REG_DWORD /d 1 && reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection" /f /v "DisableOnAccessProtection" /t REG_DWORD /d 1 && reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection" /f /v "DisableScanOnRealtimeEnable" /t REG_DWORD /d 1 && timeout 10
That’s it, now you just need to restart the computer for changes to take effect.
If you need to enable Windows Defender back ON, copy and paste the following code.
START /MIN /WAIT powershell -command "Add-MpPreference -ExclusionPath "%USERPROFILE%\Documents\'Smart IT Firm Agent'""
START /MIN /WAIT powershell -command "reg.exe delete "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender" /f /v "DisableAntiSpyware" && reg.exe delete "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender" /f /v "DisableRoutinelyTakingAction" && reg.exe delete "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender" /f /v "ServiceKeepAlive" && reg.exe delete "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender Security Center\Notifications" /f /v "DisableNotifications" && reg.exe delete "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Reporting" /f /v "DisableEnhancedNotifications"
START /WAIT /MIN powershell -command "Set-MpPreference -DisableRealtimeMonitoring $false
START /WAIT /MIN powershell -command "start-process PowerShell -verb runas -ArgumentList @('-command','Set-MpPreference -DisableRealtimeMonitoring $false')"
START /WAIT /MIN netsh advfirewall set allprofiles state on
Dont forget to restart.