# Disable Windows Defender

## Powershell

```bash
# To disable real-time monitoring of Windows Defender, run the following command:
Set-MpPreference -DisableRealtimeMonitoring $true

# To enable real-time monitoring, run the following command:
Set-MpPreference -DisableRealtimeMonitoring $false

# MpCmdRun.exe
"C:\Program Files\Windows Defender\MpCmdRun.exe" -RemoveDefinitions -All -DisableIOAVProtection $true   
```

## Command Prompt

```bash
# 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 disable Windows Defender permanently using 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 Windows Defender service, run the following command:   

sc query WinDefend
```
