Disable Windows Defender real time protection with a Desktop Shortcut

Published 2017-10-05, 17:31

I love how Microsoft made third party anti virus protection obsolete with Defender – it just works.

Unfortunately sometimes I need to disable (and later enable again) it’s real time protection feature because it slows down processes I know are secure – for example Gradle builds in Android Studio.

It normally takes 7 clicks to enable or disable Defender real time protection: Systray -> double click on icon -> „Virus & threat protection“ -> „Virus & threat protection settings“ -> Toggle „Real-time protection“ -> User Account Control „Yes“.

Fortunately there is a way to automate this in Powershell:

Set-MpPreference -DisableRealtimeMonitoring $true

Which means we can also create a desktop shortcut (Right click on Desktop -> New -> Shortcut):

%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File "C:/disable.ps1"

(„C:/disable.ps1“ is the file where I put the first code snippet)

In the properties you have to click „Advanced“ to activate „Run as Administrator“ so it can actually be executed.

Then to give it a nice icon, click „Change Icon“ in the shortcut properties and „open“ the icons from „%systemroot%\system32\imageres.dll“. There you’ll find a nice dark red Defender like „badge“ icon with a white x:

The real time protection feature will turn itself back on after some time. Alternatively you could replace „$true“ with „$false“ in a copy of that script to have a shortcut to enable it again. Or spend some time to figure out how to actually „toggle“ in on and off with the same shortcut by somehow doing this in the Powershell script. (Let me know if you do!)

Source: Script via StackOverflow answer by ‚djsmiley2k‘ to my question and icons file for the shortcut

Topic(s): Kram No comments - :(

Diskussion zum Artikel

» Selbst kommentieren

  1. Zum Artikel Disable Windows Defender real time protection with a Desktop Shortcut sind noch keine Kommentare vorhanden. Deine Meinung wäre jedoch willkommen!

Selbst kommentieren

Trackback-URI, Kommentarfeed. XML-Feed





15 queries. 0,117 seconds.