How can I disable Windows Defender using the command line?

5

I am looking for a way to disable Windows Defender on Windows 8/8.1/10 using the command line. Everything I've found so far has involved using a GUI at some point, and this isn't useful for a process I am looking to automate using a script. Thanks in advance.

AWarnock

Posted 2016-01-12T16:22:49.187

Reputation: 51

Question was closed 2016-01-14T12:38:01.877

@Moab I did see that one, but I need a way to do it using the command line, preferably without batch files or similar. – AWarnock – 2016-01-13T15:05:08.973

A batch file is nothing more than a bunch commands for the command prompt, the reason you use a batch file is because there is too many commands to do it manually for what you want to do. – Moab – 2016-01-13T15:51:56.450

Answers

4

The easiest way to do this would be to use PowerShell to disable it, the command you probably want is this:

Set-MpPreference -DisableRealtimeMonitoring $true

For an article on using PowerShell to disable/enable Windows Defender check here: http://wmug.co.uk/wmug/b/pwin/archive/2015/05/12/quickly-disable-windows-defender-on-windows-10-using-powershell

Here is the TechNet article for a more detailed look at available defender cmdlets: https://technet.microsoft.com/en-us/library/dn433280.aspx

enter image description here

Abraxas

Posted 2016-01-12T16:22:49.187

Reputation: 3 704

Thanks for the links. I guess I missed those in my searching. – AWarnock – 2016-01-13T15:06:04.490

@AWarnock Absolutely! Let me know if you need any more information in order to mark this as the accepted answer. – Abraxas – 2016-01-13T17:21:20.263

You must use PowerShell (Command prompt) – YumYumYum – 2018-02-02T15:40:44.050