Unable to remove "Scan with Windows Defender" from Windows Explorer context menu

Frank Macintosh 51 Reputation points
2023-03-18T14:28:54.1033333+00:00

A moderator at answer.microsoft.com tried to post this question on my behalf, but it appears at learn.microsoft .com with corrupted formatting. She suggested that I try re-posting, so here goes (fingers crossed).

To remove `Scan with Windows Defender` from Windows Explorer's context menu, I obtained `remove Scan with Windows Defender.reg` from here:

https://winaero.com/download-remove-scan-with-windows-defender-context-menu-in-windows-10

    Windows Registry Editor Version 5.00
    [-HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\EPP]
    [-HKEY_CLASSES_ROOT\Directory\shellex\ContextMenuHandlers\EPP]

The first command removes `Scan with Windows Defender` from the file context menu.  The second removes it from the folder context menu.

I ran the above `*.reg` file from an administrator account *without* `regedit` running.  I then fired up `regedit` and checked that the *second* key is gone, rebooted the laptop, and confirm that `Scan with Windows Defender` is gone from the *folder* context menu.

Perplexingly, however, it is still present in the *file* context menu.  Furthermore, the *folder* key `HKEY_CLASSES_ROOT\Directory\shellex\ContextMenuHandlers\EPP` still exists, containing value `(Default)` set to `{09A47860-11B0-4DA5-AFA5-26D86198A780}`.

I went back through years of computer housekeeping and found that in 2020 (https://superuser.com/questions/1532962/malwarebytes-re-installation-removes-single-file-scan-from-context-menu), `Scan with Windows Defender` was added to the following `shell` keys rather than the above `shellex` keys:

    HKEY_CLASSES_ROOT\*\shell\WindowsDefender
    HKEY_CLASSES_ROOT\*\shell\WindowsDefender\Command

The asterisk makes it impossible to track down manually.  **Is this why `Scan with Windows Defender` remains in the *file* context menu?**

Before answering, please note from the above 2020 page that `Scan with Windows Defender` was also added to the *folder* context menu via a corresponding `shell` key.  However, the above command specifying a `shellex` key seemingly removed removed the item from the *folder* context menu (even though the corresponding `shellex` key remains!)

I also tried the procedure at https://www.intowindows.com/how-to-remove-scan-with-windows-defender-from-context-menu-of-windows-10, which requires removal of key `HKEY_CLASSES_ROOT\CLSID\{09A47860-11B0-4DA5-AFA5-26D86198A780}`.  On my machine, this does not appear under `CLSID`.

The page https://www.ampercent.com/remove-scan-windows-defender-context-menu-windows-10/17882 additionally says to try `regsvr32 /u "C:\Program Files\Windows Defender\shellext.dll"`, but it generates a `RegSvr32` popup error `The module "c:\Program Fileis\Windows Defender\shellext.dll" was loaded but the call to DllUnregisterServer failed with error code 0x8002801c. For more information about this problem, search online using the error code as a search term."  

Following the success at https://superuser.com/a/1214921/767015, I installed before uninstalling, but it didn't work (I got similar error messages after both commands):

     regsvr32 /i "C:\Program Files\Windows Defender\shellext.dll"
     regsvr32 /u "C:\Program Files\Windows Defender\shellext.dll"

**What else can I try to remove `Scan with Windows Defender`?**  I suspect that I will have to install Windows Defender before the above solutions can work.  I can no longer find up-to-date information on installing the old Windows Defender.  I suspect that even if I could find it, it will be tricky to replaces the current Microsoft Defender with Windows Defender.

I tried posting this to learn.microsoft.com, but when I submit it, I get a page entitled "404 - Page not found"..

*After* doing that, I will take the next step of installing `Scan with *Microsoft* Defender` on Windows Explorer's context menu.  Microsoft Defender is my current antivirus.

Windows 10 Security
Windows 10 Security
Windows 10: A Microsoft operating system that runs on personal computers and tablets.Security: The precautions taken to guard against crime, attack, sabotage, espionage, or another threat.
2,948 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Sedat SALMAN 14,140 Reputation points MVP
    2023-03-19T20:49:26.88+00:00

    It looks like you have already tried several methods to remove "Scan with Windows Defender" from the context menu without success. One thing you could try is to use a third-party tool called ShellExView to disable the context menu handler for Windows Defender.

    Here's how to use ShellExView:

    1. Download and install ShellExView from the NirSoft website (https://www.nirsoft.net/utils/shexview.html).
    2. Launch ShellExView and wait for it to load all the context menu handlers.
    3. Scroll down to find the handler named "Microsoft Defender Antivirus" or "Windows Defender" (depending on the version of Windows you're using).
    4. Right-click on the handler and choose "Disable Selected Items" from the context menu.
    5. Restart your computer and check if "Scan with Windows Defender" is still present in the context menu.

    If this method doesn't work, you could also try creating a custom context menu handler using a registry tweak. Here's how to do it:

    1. Open the Registry Editor by typing "regedit" into the Start menu and pressing Enter.
    2. Navigate to the following key: HKEY_CLASSES_ROOT*\shell
    3. Right-click on the "shell" key and choose "New" > "Key".
    4. Name the new key whatever you like (e.g., "Scan with Microsoft Defender").
    5. Right-click on the new key and choose "New" > "Key".
    6. Name the new key "command".
    7. Double-click on the "(Default)" value in the "command" key and enter the following value: "C:\Program Files\Windows Defender\MpCmdRun.exe" -Scan -ScanType 3 -File "%1"
    8. Click "OK" to save the value.
    9. Close the Registry Editor and check if "Scan with Windows Defender" is still present in the context menu.

    This method should add a new context menu item that allows you to scan a file with Microsoft Defender instead of Windows Defender.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.