Add Scan With Windows Defender To Context Menu In Windows 8

One thing missing in Windows Defender in Windows 8, is a right-click context menu that will allow a user to scan any folder. Recently we told you how you could add features of Windows Defender to the Desktop right-click context menu, that would help you quickly access Windows Defender.

Some of the users asked us, how one could add Scan with Windows Defender option for a file and folder. Thanks to a tip by a guest commenter on TWC, we have developed this tutorial. Read on to find out, how to go about adding this option to folder’s right click context menu.

Add Scan With Windows Defender To Context Menu

add scan with windows defender to context menu

First we’ll see the manual method, then we can go for the automatic fix..

Manual Method

1. Press Windows Key + R combination, type Regedt32.exe in Run dialog box and hit Enter to open the Registry Editor.

2. Navigate yo the following registry key:

HKEY_CLASSES_ROOT\folder\shell

3. Create a sub key in the left pane, name it WindowsDefender.

4. In the right pane of above created sub-key, create two DWORDS and use following data for them:

Icon – %ProgramFiles%\\Windows Defender\\EppManifest.dll

This adds the Windows Defender Icon.

MUI – Scan With Windows Defender

You can use any text here, that you want to show incontext menu.

5. Now we have to assign a command. So create the sub-key Command under the key WindowsDefender.

6. In the right pane of above created sub key, modify default DWORD value with following command:

“C:\Program Files\Windows Defender\MpCmdRun.exe” -scan -scantype 3 -SignatureUpdate -file %1

7. That’s it. Now pick any folder and right-click on it to get the Windows Defender’s scan option. It will scan and you’ll see a command prompt window for some seconds. Any infection will be reported via this command prompt window.

Automatic Fix

If you do not want to follow the manual method, then to help you more we have created direct registry file fix, which will let you add or remove the Scan with Windows defender to your context menu in Windows 8.

Update – 10th November 2012: The Registry file has been updated thanks to the comments made below. You can download it from HERE. You can also watch the video.

Hope this makes using Windows Defender in Windows 8 easier to you!

Microsoft has made available a PowerShell script that can help you add Scan With Windows Defender To Context Menu. Get it here.  You can also Add Scan With Windows Defender To Context Menu using our Ultimate Windows Tweaker 3.

Posted by on , in Category Windows with Tags
An Electrical Engineer by profession, Kapil is a Microsoft MVP and a Microsoft Content Creator. Please read the entire post & the comments first & create a system restore point before making any changes to your system.

30 Comments

  1. Hans-Peter

    Excellent idea and very helpful to provide the reg file for merging with the Registry; but after I performed the merge and tested the context menu on several folders there was no visible indication that Defender was actually being ‘called’ and doing a scan on the selected object.

    Would evidence of Defending actually having run be seen only if a threat were found?

  2. Most probably, Yes!

    And of course the infection is displayed by command prompt, as we’ve already mentioned it in article 🙂

  3. Fernanda Archeman

    It didn’t work for me. The option to scan do not appear for files, just for folders. And when I select this option for scanning a folder a erro messenging is showed: “Windows Cannot acess to specified device, path or file. You may not have the appropriate permissions to acess the item”. What can I do to fix this?

  4. Hans-Peter

    I can (re)confirm Fernanda Archeman’s observations. Neither the ‘Auto Fix’ Reg files download nor the manual instructions resulted in an operational Defender Scan from the context menu.

    No command prompt window ever materialized but instead always the same error window as reported by Archeman.

    I suspect the problem lies with the Command sub-key argument. When I messed around with it I only got as far as ‘not finding the application’.

    Until Microsoft updates Defender’s interface, I conclude it is simpler and more efficient to install Malwarebytes on Windows 8 Pro; but I repeat my earlier appreciation of Kapil’s effort!

  5. 1 – The method is applicable to folders only, refer first two paras of article.

    2 – You are going to scan the files, whose ownership are stored to TrustedInstaller. First take the ownership of files and then scan. It should go fine 🙂

  6. Niraj1988

    Hello Kapil

    This is not exactly what we people were waiting for.. why its opening in cmd mode which is not familiar like previous mse scan and its working only with folder..however you guys have work really good..but now i am asking is there any way to remove windows defender completely from windows 8 so that we can install Microsoft security essential again..Actually i don’t like any other antivirus application because those antivirus do my pc slow..So please do something great work either create registry hack so that windows defender can work like mse or find a way to remove windows defender completely so that we can install mse again..

    Thanks

  7. Windows Defender doesn’t provides an option to scan the specific folder, its our own assumption and trick to do so, so you have to tolerate cmd 🙂

    You can’t uninstall Windows Defender completely as far as I know because its a Windows component like Internet Explorer.

    However you can disable Windows Defender services at start up (SERVICES.MSC -> Windows Defender Service [Stop it]) and then install MSE so that contradiction can be stopped.

    Hope this helps 😀

  8. Vasudev

    “Windows Defender doesn’t provides an option to scan the specific folder……..”
    Hi Kapil, Windows Defender does provide an option to scan a specific folder with ‘Custom’ Scan option!

  9. Sorry.. I forgot that.. Thanks for reminding 😉

  10. Lars

    For the “Windows Cannot acess to specified device, path or file. You may not have the appropriate permissions to acess the item” error, I believe you need to replace the double-quotes in the sub-key’s default DWORD value. e.g. if you follow the manual method & copy-paste the instructions above it won’t work until you replace the “. It might be this website’s formatting, it replaced the double-quotes with another symbol (” in italics maybe)?

    e.g. the sub-key should read “C:Program FilesWindows DefenderMpCmdRun.exe” -scan -scantype 3 -SignatureUpdate -file %1
    (just make sure the double-quotes are really double-quotes in case this website formats it incorrectly again)

  11. Amar Jeet

    Hey dude you can use it for any file as well just add it in the path [HKEY_CLASSES_ROOT*shellWindowsDefenderCommand]
    @=””C:\Program Files\Windows Defender\MpCmdRun.exe” -scan -scantype 3 -SignatureUpdate -file %1″ and you done. Also after disable the service of WD you can’t install MSE because it is not compatible with windows 8. But I will really love to see GUI scan rather than cmd.

  12. Minh Thi?n

    This is NOT WORKING because -file %1 is wrong, the correct command should be -file “%1”.
    If you don’t believe me, go scan your biggest folder and the scan window will disappear in 1 second. Why? Because it is not scanning.
    Go check C:UsersAppDataLocalTempMpCmdRun.log, it will only tell “Start Time:” and “End Time:”, that is all.
    The working log should say “MpScan() started
    MpScan() was completed” and more informations.
    So this is the fix i made in Add-Windows-Defender-Folder.reg:

    Windows Registry Editor Version 5.00

    [HKEY_CLASSES_ROOTFoldershellWindowsDefender]
    “MUIVerb”=”Scan with Windows Defender”
    “Icon”=”%ProgramFiles%\Windows Defender\EppManifest.dll”
    @=””

    [HKEY_CLASSES_ROOTFoldershellWindowsDefenderCommand]
    @=””C:\Program Files\Windows Defender\MpCmdRun.exe” -scan -scantype 3 -file “%1″”

    Here is the link for you to download new working files
    http://www.mediafire.com/?aefklxvo2j55m44

  13. Scott Lanford

    If you also want to add a context menu to scan individual files simply follow the instructions in this article but add the keys to HKEY_CLASSES_ROOT*shell rather than HKEY_CLASSES_ROOTfoldershell.

  14. mark c

    the command window closes so fast, cant read anything, can you make command window pause long enuf to at least be able to read??

  15. mark c

    the command window closes so fast, cant read anything, can you make command window pause long enuf to at least be able to read??

  16. illferris

    Add && Pause to the end of the command string. It should look like this:

    “C:Program FilesWindows DefenderMpCmdRun.exe” -scan -scantype 3 -file “%1” && PAUSE

    I actually find that for scanning one file, it is much faster in the cli, and now actually prefer it that way as superior to opening the gui which you may notice would take a bit longer.

    You could also have it close automatically after *n amount of time by issuing a ping and then exit. So then the command to wait 10 seconds before exiting would look like this:

    “C:Program FilesWindows DefenderMpCmdRun.exe” -scan -scantype 3 -file “%1” && PING 0.0.0.0 -n 10 -w * >NUL

    That ought to give you ample time to see the result of the scan.

    I also am finding that most if not all of the Win8 FUD on the net, is from ignorant n00bs who are probably better off spending $2000 on a Mac. As for the rest of us, Windows 8 is the best OS ever invented and Microsoft continue to lead the globe in innovation on the desktop and the server/cloud.

  17. nhymxu

    only for folder, not for one or more selected file?

  18. Más Sergio

    its not working just a black screen shows then disaperas… f it ill just use malwarebytes right click option lol

  19. khalid

    Similar concern here.

    Thanks again for the walk through on how to get this back. Certain things that Microsoft did with windows 8 surprise me. I’m starting to wonder if I even need to upgrade from windows 7.

  20. William Zhao

    This doesn’t seem to work for me… adding the && just makes it instantly fail. Any other way of adding a pause?

  21. Easy.

    HKEY_CLASSES_ROOTFoldershellwindowsdefender
    Icon = %ProgramFiles%Windows DefenderEppManifest.dll
    MUIVerb = Scan with Windows Defender

    HKEY_CLASSES_ROOTFoldershellwindowsdefenderCommand
    Default = “C:\Program FilesWindows DefenderMpCmdRun.exe” -scan -scantype 3 -file “%1”

    ^– FOR FOLDERS –^
    ———————
    v—- FOR FILES —-v

    HKEY_CLASSES_ROOT*shellwindowsdefender
    HKEY_CLASSES_ROOT*shellwindowsdefenderCommand
    Same strings.

    Trying to find how to PAUSE the damn thing.

    HOWEVER, make a .cmd file in Notepad, call it “Windows Defender (Scan)”.
    Add:

    @ECHO OFF
    C:Program FilesWindows DefenderMpCmdRun.exe” -scan -scantype 3 -file %1
    PAUSE

    (Unlike the strings, if you quote the %1 here, it won’t work.)

    If you want an icon, create a shortcut pointing to the .cmd, using EppManifest.dll for the icon.

    I put my command files in a folder in Documents, shortcut goes to SENDTO.
    (C:Users****AppDataRoamingMicrosoftWindowsSendTo)

    The latter works for BOTH files AND folders. Hope this helps.

  22. another markc

    How is that last paragraph relevant to this topic, other than the fact that we’re tweaking something now????

  23. another markc

    And neither of those solutions worked for me either.

  24. Kurt

    What about VISTA? I’d like very much to apply the REG file to my VISTA installation but am afraid it might be WIN8 specific.

  25. Anon

    Step 4: has anyone else noticed that those aren’t DWORDS? The icon for DWORDS is a half sheet of paper with blue 0’s. Those are just string values.

  26. Prince Of Persia Cdeb

    Just the answer i was looking for. great job dude. thanks

  27. ??? ????

    Maybe this can help to some people who want to see the result after the scanning

    And sorry for my poor english

    http://db.tt/kPGMN1Xa

    If you need the password please email me.
    It’s not any of those surveys.
    Send me a email and I will response you
    If there’s any problem please contact.

    johnjonsson1@hotmail.com

    Thank you

  28. ??? ????

    password : NightSky

  29. ??? ????

    Maybe this can help to some people who want to see the result after the scanning

    And sorry for my poor english

    http://db.tt/kPGMN1Xa

    If you need the password please email me.
    It’s not any of those surveys.
    Send me a email and I will response you
    If there’s any problem please contact.

    johnjonsson1@hotmail.com

    Thank you

  30. John Jonsson

    you may simple add the file in the context menu like what you did in registry

    instead of

    HKEY_CLASSES_ROOTFoldershellwindowsdefenderCommand
    Default = “C:\Program FilesWindows DefenderMpCmdRun.exe” -scan -scantype 3 -file “%1”

    Change to the destination of your cmd file created

    Example :

    HKEY_CLASSES_ROOTFoldershellwindowsdefenderCommand
    Default = “C:\Users****Documentsxxxxx.bat” -scan -scantype 3 -file %1

    xxxx will be the name of the cmd file created ( It can be whatever name, like Defender Scan )

    And the others remains the same

    HKEY_CLASSES_ROOTFoldershellwindowsdefender
    Icon = %ProgramFiles%Windows DefenderEppManifest.dll
    MUIVerb = Scan with Windows Defender

    Remember to add these commands for folders and files ( like the same above, only changing the part that I said above )

    Tested it and worked.
    If still occurs error or any problem that you encountered, please left a post.

    P.S.
    Sorry for my bad English

Leave a Reply

Your email address will not be published. Required fields are marked *


7 + 7 =