How to Disable Windows Defender Using PowerShell, Command Line?

Microsoft Defender also Known as Windows Defender is an anti-malware component of Microsoft Windows. It is an official Protection Program provided by Microsoft to Protect computers running windows from Spyware and malware. Many users think that it’s a new program Which is introduced in Windows 10, but actually, it has a very long story, At first, the concept of Microsoft Defender is based on GIANT AntiSpyWare from the GIANT Company software. Then this company was acquired by Microsoft on December 16, 2004. It was first released to the public as a downloadable free antispyware program for Windows XP, then later shipped with Windows Vista and Windows 7. After it has evolved into a full antivirus program, replacing Microsoft Security Essentials as part of Windows 8. Finally, in windows 10 it is known as Windows Defender before Windows 10 November 2019 Update or Windows Defender Antivirus in Windows 10 Creators Update and later.

Windows Defender Protect Your PC by these Seven security areas mentioned below:

  1. Virus & threat protection – This feature runs scans, detects threats, and downloads updates to help identify new viruses and malware. On version 1709, this section also offers configuration settings for controlled folder access.
  2. Account Protection – When you sign in to Windows, the new Account Protection pillar protects your identity. You will be encouraged to set up Windows Fingerprint, Hello Face, or PIN sign-in. If applicable, Account Protection will also notify you if Dynamic Lock has stopped working because your PC’s Bluetooth is inactive.
  3. Firewall & network protection – In this area, you will be able to manage the Windows Defender Firewall settings. You can also monitor what’s happening with your Internet connections and networks.
  4. App & browser control – This feature allows you to use Windows Defender Smart Screen, which can protect your computer against potentially dangerous files, sites, apps, and downloads. Moreover, it provides a customization exploit protection feature.
  5. Device Security – You can get a better insight into the security features integrated with your Windows computer. You can access this area to manage your PC’s built-in security features. Moreover, you can use it to generate security status reports.
  6. Device performance & health – Access this page to get reports on your computer’s performance and health. This feature can also help you keep your PC clean and up-to-date with the latest version of your operating system.
  7. Family options – If you’re a parent, you can use this feature to manage your children’s online experience.

Even though Windows Defender has very good protection at some point of time if you are decided to Disable Windows Defender using command line, then this article will guide you to Disable Windows Defender using command line and PowerShell.

Disable Windows Defender using Settings:

In this method we use windows Settings, Using windows settings we can easily Disable Windows Defender.

  • Open Windows Settings by pressing Windows + I, click on Update and Security, From the Right-hand pane Click on Windows Security.
  • Once you clicked, from the left-hand pane you can see open Windows security. Now you will get the Windows Security Program page.

Or

  • You can directly search in the Cortana search bar for Windows defender and click on it.
  • Once the windows defender program open Click on Virus and thread protection from the left-hand pane.
  • Under Virus and thread protection settings, click on manage settings.
  • Toggle the switch to off under Real-time protection.
Turn off Real time protection
  • Once you turn off the Real-time Protection it Locates and stops malware from installing or running on your device automatically, But Manual scan will be available at your disposal.

Disable Windows Defender using command Prompt:

  • Press Windows + X and Open Command Prompt in administrator mode.
  • Now type the following command to disable Windows Defender.

sc stop WinDefend

  • This command will stop the Windows Defender service, if the service is unstoppable you will receive the [SC] OpenService FAILED 5: Access is denied. Error.

To enable it back run the following command.

sc start WinDefend

  • This command will enable the windows defender back, if the service is already running then you will receive the instance of the service is already running. Error.

To enable it again on startup run the following commands:

sc config WinDefend start= auto sc start WinDefend

To check the Current status of windows defender service, run the following command:

sc query Windefend

defender current status

This command will check the STATE variable. If the service is already running it should show Running STATE.

Using PowerShell

PowerShell is the most advanced that Command prompt, Using Powershell we can turn off windows defender on Multiple Computers over the network. And also using PowerShell we can particularly turn off the real-time monitoring of windows defender.

Open PowerShell with administrative privileges.

Disable Using PowerShell:

Run the following command to disable windows defender

Set-MpPreference -DisableRealtimeMonitoring $true

Disable Windows Defender using PowerShell

This command will turn off the real-time monitoring of windows defender.

Enable Using PowerShell:

Run the following command to disable windows defender

Set-MpPreference -DisableRealtimeMonitoring $false

This command will turn on the real-time monitoring of windows defender. The above-mentioned command will only turn off/on real-time monitoring, if you want to disable windows defender completely, run the following command in the PowerShell admin mode.

Uninstall-WindowsFeature -Name Windows-Defender

Disable Using Group Policy

This method is for network administrators, If you are a network administrator and if you want to disable Windows defender for many systems using Group policy then this method will guide you to Disable windows defender using group policy editor.

Open run command by pressing Windows + R and type gpedit.msc and hit enter, this command will open Group Policy Editor.

Navigate to the following path

Computer Configuration –> Administrative Templates –> Windows Components –> Windows Defender Antivirus

From the right-hand pane, Search for Turn Off Windows Defender Antivirus and open and Enable the Group Policy editor.

Disable Windows Defender using Group Policy Editor

Click apply and give OK.

Disable using Windows Registry

Registry editor is one of the best options in windows 10 to disable or enable any windows settings. In this method, we are going to use the registry editor to disable windows editor. Follow the steps below.

Open run command by pressing Windows + R and type Regedit and hit enter, this command will open the windows registry editor.

Now navigate to the following location.

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender

From the right-hand pane right-click on any empty area and New> DWORD 32 bit value Name the DWORD as DisableAntiSpyware.

Right-click on the new DWORD and choose modify. Modify the value to 1. And give OK,  Restart the machine to make it effective.

Disable Windows Defender using Registry Editor

From the next restart the Windows Defender will not load, If you want to enable it back, follow the above-mentioned steps and delete the registry key, or Modify the value to 0.

Note: Windows Defender is a security feature you can’t uninstall or remove it completely. These methods will allow you to disable it for temporarily. It will restore automatically in the next windows update.

Read Also:

How to Disable Non-critical notifications from Windows Security?

How to scan individual Files and Folders using Microsoft Defender?

How to Enable Microsoft Defender Application Guard for Office?

How to Update Windows Defender Virus signature using Command Prompt?

What is mpcache.exe? How to Delete mpcache files in Windows 11?

1 thought on “How to Disable Windows Defender Using PowerShell, Command Line?”

  1. Philmore Minjentidz

    On 1903, NONE of this works. Not registry, not Group Policy, not command prompt & not Powershell. I had already tried reg & GP, then after seeing this page I tried admin command prompt & admin PS. CMD says “Access Denied” as you mention & PS says it does not recognise Uninstall-WindowsFeature as a valid cmdlet. Typing “Windows Defender” in Cortana brings up the firewall. If I try to open Windows Defender from start menu I get a blank .. perhaps I would have a better run if I reinstalled & tried this straight away. Anyway, just letting you know & thanks for your time & effort. I will install third party AV & this should disable WinDef.

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top