There are times when we want to turn off Windows Defender on Windows 10 quickly. For example, if we are installing a software which requires that the antivirus should be disabled during installation (yes there are some software which requires this).
Windows Defender is an all in one security software from Microsoft consisting of antivirus and a firewall. Windows Defender comes pre-installed with Windows 10. 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 it on or turn off Windows Defender Windows 10 or even Windows 8/8.1. You should choose the best method according to the version of Windows you are using.
Table of Contents
Why turn off Windows Defender?
A general recommendation in terms of security is that you should always have security enabled for your PC at all times. This could be using Windows Defender, Microsoft’s own security solution built into Windows 10, or using a third-party security tool.
Sometimes you will need to disable antivirus and firewall protection in Windows. For example, when you are playing a game but the antivirus keeps on scanning the files and slows down the system. Another example can be when the antivirus detects a program as a false positive although you know that the program is completely safe to use.
Some people believe that it is safe to turn off Windows Defender and use cracking software. This includes activating Windows using illegal tools like KMSPico or the Microsoft Toolkit. These cracking tools are not safe at all. They may inject malware into the system that may not be detectable by the antivirus after installation. The malware is used for cryptomining and other hacking purposes.
There are two ways to turn off Windows Defender, either temporarily or permanently. We will discuss both ways here.
How to Turn Off Windows Defender Using Windows Settings
If you want to turn Windows Defender on or off using Windows Settings, follow the steps below:
- Open Windows Settings (Windows key + i)
- Go to Update & Security –> Windows Security
- From the right-hand pane, select Manage settings under Virus & threat protection settings.
- Toggle the switch to Off under Real-time protection.
This will turn off real-time protection while a manual scan is available at your disposal.
How To Disable Windows Defender Using Command Prompt
To turn off Windows Defender using Command Prompt, follow these steps:
-
Run the following command to disable Windows Defender:
sc stop WinDefend
-
To make sure that Windows Defender is stopped, run this command:
sc query 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 once the system is restarted.
To disable Windows Defender permanently using the command prompt, run the following command:
sc config WinDefend start= disabled
sc stop WinDefend
To enable it again on startup, run the following commands:
sc config WinDefend start= auto
sc start WinDefend
If you want to check the current state of the Windows Defender service, run the following command:
sc query WinDefend
Check the STATE variable. It should be in RUNNING state if it is enabled.
How To Permanently Disable Windows Defender Using PowerShell
One advantage of PowerShell is that you can deploy changes to Windows Defender on multiple computers across the network.
If you prefer PowerShell way, follow the steps below:
- Run PowerShell with administrative privileges (Windows key + X + A)
- To disable real-time monitoring for Windows Defender, 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 turn off real-time monitoring of Windows Defender. If you want to completely remove Windows Defender from Windows 10, use the following PowerShell command:
Uninstall-WindowsFeature -Name Windows-Defender
How To Permanently Turn Off Windows Defender Using Group Policy
If you are a network admin and want to disable Windows Defender from your network, it is wise to use Group Policy. Just follow the steps below to turn off Windows Defender using the Group Policy editor:
- Open Group Policy Editor (Run –> gpedit.msc)
- Go to Computer Configuration –> Administrative Templates –> Windows Components –> Windows Defender Antivirus
- From the right-hand pane, open Turn off Windows Defender Antivirus and select Enabled
This setting can be accessed through Local Group Policy as well as Domain Group Policy. The local policy will turn off Windows Defender for all local users while the domain policy will disable it for all systems on which the policy is applied.
How To Permanently Disable Windows Defender Using Windows Registry
You can also disable Windows Defender permanently from Windows Registry just by creating or altering a few registry keys.. Follow the steps below:
- Go to Run –> regedit. This will open the Windows Registry Editor.
- Navigate to the following key:
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender - In the right pane, right-click 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 either delete the created registry key or simply change its value to 0.
Please note that you can’t completely uninstall the Windows Defender. Even if you manage to delete its service or files, it will most likely be restored on the next major Windows update.
There are a few scenarios where the user wants to disable a specific part of the Windows Defender system. We will discuss the scenarios below.
How to turn off Windows Firewall only
To turn off Windows Firewall only and keep using other Windows Defender functionality, follow the steps below:
- Open Windows Settings (Windows key + i)
- Click on Update & Security and then Windows Security
- In the right-hand pane, click on Open Windows Security
- From the left-hand pane, select Firewall & network protection
- In the right-hand pane, you will see three protection types. Domain network, Private network, Public network.
- Click on each network type and toggle it to disabled.
This will only turn off the firewall. The antivirus and other functionality of Windows Defender will keep on working.
How to turn off Windows Defender real-time antivirus only
If you want to turn off the antivirus real-time functionality only, you can follow the steps below:
- Open Windows Settings (Windows key + i)
- Click on Update & Security and then Windows Security
- From the left-hand pane, click on Virus & threat protection
- In the right-hand pane, toggle real-time protection to off.
Verdict
If you have not installed any third-party antivirus, then you should keep Windows Defender running as it will protect you from the 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 disable the security software temporarily.
I hope this has been informative for you. If there are any other easier ways to enable or disable Windows Defender, please let us know in the comments below!
15 comments
kuba4ful
To everyone who gets “Access Denied”, you can circumvent it by logging into cmd as TrustedInstaller.
Mohammadreza Rashad
Would you please explain a bit? Using NirSoft AdvancedRun, I still recieve “Access denied” error. I ran AdvancedRun as admin, typed the cmd.exe full path in “Program to run” field, and set “trustedInstaller” in “Run as” combo box; But when click
charlie
thru powershell admin type Set-MpPreference -DisableRealtimeMonitoring $true for off and $false for on
Sergio
Windows 10 20H2 build 19042.685 with latest updates – nothing works!!!
w
“sc stop WinDefend” now results in “access denied”
Gori
A competent powershell script like ToggleDefender is needed
pastebin.com/hLsCCZQY
(save as .bat script or copy-paste directly into console – it’s a hybrid)
It shows a simple Yes,No,Cancel prompt
Sam
That script is epic! love the commenting!
Usman Khurshid
did you run the command as administrator?
edward
yes
k
Good details and comprehensive article.
I need to prevent Defender from starting after reboot, the only method that works now is gpedit.
Matthew
This does not work anymore because of the MS introduced Defender Tamper protection in 1903.build 18362.418
Me and others have tested the GPO method and such and it can’t be stopped at the moment it would seem.
I am admin on my system and cannot stop it with command prompt, also generated as error that the function does not exist when i copy/paste the powershell command on this topic in order to uninstall the entire service.
Shameer
I am facing a weired error that when opening “Windows Security”, no options are shown. While I try to type “App & Browser settings” directly, it goes inside, but later provides an error mentioning “Unexpected Error. Sorry, we ran into a problem. Please try again”.
ACAST
I’m using local administrator account and I enabled local Administrator account as well to test with it and still get the same results, but I did find a way to disable this via registry so I’m good for now…thanks.
ACAST
I’ve tried using an elevated command prompt and nothing I do that I’m researching online is helping solve the “[SC] OpenService FAILED 5: Access is denied” when I’m trying to run the sc config commands for disabling Windows Defender
Usman Khurshid
Please check if you can disable/enable any other service using the sc command. If you get the same error, that means you’re not logged in as administrator.