Add a “Scan with Windows Defender” context menu to any folder or file

Windows Defender is the virus scan tool that is included with Windows 8 and later. While it provides basic security it does not have any of the convenience functions that other virus scanners have. In particular I miss a context menu option to scan a file or folder.

ScanWithWindowsDefenderMenu

So I turned to Google and found How to add the Windows defender into Windows Explorer’s right click menu on SuperUser and How to Add Any Application Shortcut to Windows Explorer’s Context Menu on How-To Geek. Both go through great length with pictures and text to describe how to do it, but basically a simple .reg file would have been sufficient.

To add a "Scan file with Windows Defender" entry for all files, you need this:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell\WindowsDefender]
"Icon"="%ProgramFiles%\\\\Windows Defender\\\\EppManifest.dll"
"MUIVerb"="Scan with Windows Defender"

[HKEY_CLASSES_ROOT\*\shell\WindowsDefender\Command]
@="\"c:\\Program Files\\Windows Defender\\MpCmdRun.exe\"  -scan -scantype 3 -SignatureUpdate -file %1"

(download link)

And for a "Scan folder with Windows Defender" entry for each folder, you need this:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Folder\shell\WindowsDefender]
"Icon"="%ProgramFiles%\\\\Windows Defender\\\\EppManifest.dll"
"MUIVerb"="Scan folder with Windows Defender"

[HKEY_CLASSES_ROOT\Folder\shell\WindowsDefender\Command]
@="\"c:\\Program Files\\Windows Defender\\MpCmdRun.exe\"  -scan -scantype 3 -SignatureUpdate -file %1"

(download link)

Both open a console window for the console version of Windows Defender to run. That’s a bit ugly but we aren’t in this for a design award, are we?

To add these files to the registry just double click them. Windows will warn you about possible threads. It’s a good idea to read through files like these before double clicking. Maybe I am just trying to hack your computer? 😉

It works for me on Windows 8.1, but it should also work on other Windows versions like 10.