1. Disable

  • Enter the following commands at a Command Prompt with administrative privileges.

    set "Key=HKLM\Software\Policies\Microsoft\Windows Defender"
    reg add "%Key%" /v "DisableAntiSpyware"          /t REG_DWORD /d "1" /f > nul
    reg add "%Key%" /v "DisableRealtimeMonitoring"   /t REG_DWORD /d "1" /f > nul
    set "Key=HKLM\Software\Policies\Microsoft\Windows Defender\Real-Time Protection"
    reg add "%Key%" /v "DisableBehaviorMonitoring"   /t REG_DWORD /d "1" /f > nul
    reg add "%Key%" /v "DisableOnAccessProtection"   /t REG_DWORD /d "1" /f > nul
    reg add "%Key%" /v "DisableScanOnRealtimeEnable" /t REG_DWORD /d "1" /f > nul
  • Restart the computer.

2. Enable

  • Enter the following commands at a Command Prompt with administrative privileges.

    set "Key=HKLM\Software\Policies\Microsoft\Windows Defender"
    reg delete "%Key%" /f > nul
  • Restart the computer.