There are times when we want to enable or disable Windows Defender in Windows 10 quickly. For example, if we are installing software that requires the antivirus to be disabled during installation (yes, there is some software that does).
Windows Defender is an all-in-one security software from Microsoft that consists of an antivirus and a firewall. Windows Defender comes pre-installed with Windows 10. And it gets all its updates from Windows Update.
Although you can turn Windows Defender on or off from Windows settings, there are other quick ways to turn Windows Defender on or off in Windows 10 or even Windows 8/8.1. You should choose the best method based on the version of Windows you are using.
So, let’s start with enabling/disabling Windows Defender using Command Prompt:
Using the command prompt
Open command prompt with administrative privileges. (Search for CMD or command prompt at startup and run as administrator)
- Run the following command to disable Windows Defender:
sc stop WinDefend
- To enable Windows Defender again, run the following command:
sc start WinDefend
Please note that this is a temporary method to stop Windows Defender. The service will return to its original state when the system is restarted. To permanently disable Windows Defender using Command Prompt, run the following command:
sc config WinDefend start=disabled
sc stop WinDefend
- To enable it again at startup, run the following commands:
sc config WinDefend start= auto
sc start WinDefend
- If you want to check the current status of the Windows Defender service, run the following command:
sc query WinDefend
- Check the STATUS variable. It should be in RUNNING state if enabled.
One benefit of PowerShell is that you can deploy changes to Windows Defender to multiple computers on your network.
If you prefer the PowerShell way, follow the steps below:
- Run PowerShell with administrative privileges (Windows Key + X + A).
- To disable Windows Defender real-time monitoring, run the following command:
Set-MpPreference -DisableRealtimeMonitoring $true
- To enable real-time monitoring, run the following command:
Set-MpPreference -DisableRealtimeMonitoring $false
The above method will only disable Windows Defender real-time monitoring. If you want to completely remove Windows Defender from Windows 10, use the following PowerShell command:
Uninstall-WindowsFeature -Name Windows-Defender
Using Windows Settings
If you want to turn Windows Defender on or off via Windows Settings, follow the steps below:
- Open Windows Settings (Windows key + i).
- Go to Update & Security -> Windows Security.
- In the right pane, select Manage settings under Virus & threat protection settings.
- Move the switch to Off under Real-time Protection.
This will disable real-time protection while manual scanning will be available at your disposal.
Using group policy
If you are a network administrator and want to disable Windows Defender from your network, it is advisable to use Group Policy. Just follow the steps below to disable Windows Defender using Group Policy editor:
- Open Group Policy Editor (Run -> gpedit.msc).
- Go to Computer Configuration -> Administrative Templates -> Windows Components -> Windows Defender Antivirus.
- In the right pane, open Turn off Windows Defender Antivirus and select On.
These settings can be accessed through Local Group Policy and Domain Group Policy. The local policy will turn off Windows Defender for all local users, while the domain policy will turn it off for all systems that the policy is applied to.
Disable Windows Defender using the Windows Registry
You can also permanently disable Windows Defender from the Windows Registry simply by creating or modifying some registry keys. Follow the steps below:
- Go to Run -> regedit. This will open the Windows Registry Editor.
- Navigate to the following key:
- In the right pane, right-click in the empty area and create a new DWORD (32-bit) value.
- Rename the new item to DisableAntiSpyware
- Double click DisableAntiSpyware and change its value to 1.
Windows Defender will not load after the next computer restart. To enable Windows Defender again, you can delete the created registry key or simply change its value to 0.
Please note that you cannot completely uninstall Windows Defender. Even if you manage to remove your service or files, it will most likely be restored in the next major Windows update.
If you haven’t installed any third-party antivirus, you should keep Windows Defender running as it will protect you from most common virus/hacking threats while you are connected to the internet. There should always be an anti-malware solution running on your computer at all times. These methods should be used to temporarily disable security software.