Add or Remove Microsoft Defender Antivirus Exclusions in Windows 10  

Page 1 of 7 123 ... LastLast
    Add or Remove Microsoft Defender Antivirus Exclusions in Windows 10

    Add or Remove Microsoft Defender Antivirus Exclusions in Windows 10

    How to Add or Remove Exclusions for Windows Defender Antivirus in Windows 10
    Published by Category: Security System
    08 Sep 2022
    Designer Media Ltd

    How to Add or Remove Exclusions for Microsoft Defender Antivirus in Windows 10


    Microsoft Defender helps protect your PC against malware (malicious software) like viruses, spyware, and other potentially unwanted software. Malware can infect your PC without your knowledge: it might install itself from an email message, when you connect to the Internet, or when you install certain apps using a USB flash drive, CD, DVD, or other removable media. Some malware can also be programmed to run at unexpected times, not only when it's installed.

    Microsoft Defender is included with Windows and helps keep malware from infecting your PC in two ways:
    • Providing real-time protection. Microsoft Defender notifies you when malware tries to install itself or run on your PC. It also notifies you when apps try to change important settings.
    • Providing anytime scanning options. Microsoft Defender automatically scans your PC for installed malware on a regular basis, but you can also start a scan whenever you want. Microsoft Defender automatically removes (or temporarily quarantines) anything that's detected during a scan.

    See also:

    If you like, you can add exclusions to Windows Defender for files, folders (file locations), file extensions (file types), and processes that you are confident are 100% safe and secure to reduce the scan time of Microsoft Defender.

    For example, a sandbox, ISO files, or virtual machines.

    This tutorial will show you how to add or remove exclusions to Microsoft Defender Antivirus for all users in Windows 10 and Windows 11.

    You must be signed in as an administrator to be able to view, add, or remove exclusions for Microsoft Defender Antivirus.

    File and folder exclusions are stored in the registry key below.

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Defender\Exclusions\Paths

    File type exclusions are stored in the registry key below.

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Defender\Exclusions\Extensions

    Process exclusions are stored in the registry key below.

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Defender\Exclusions\Processes


    Windows Defender won't scan excluded files, so this can make your PC more vulnerable to malware.



    Contents

    • Option One: To Add an Exclusion to Microsoft Defender Antivirus in Windows Security
    • Option Two: To Remove an Exclusion from Microsoft Defender Antivirus in Windows Security
    • Option Three: To Add or Remove File Exclusion for Microsoft Defender Antivirus in PowerShell
    • Option Four: To Add or Remove Folder Exclusion for Microsoft Defender Antivirus in PowerShell
    • Option Five: To Add or Remove File Type Exclusion for Microsoft Defender Antivirus in PowerShell
    • Option Six: To Add or Remove Process Exclusion for Microsoft Defender Antivirus in PowerShell






    OPTION ONE

    To Add an Exclusion to Microsoft Defender Antivirus in Windows Security


    1 Open Windows Security, and click/tap on the Virus & threat protection icon. (see screenshot below)

    Add or Remove Microsoft Defender Antivirus Exclusions in Windows 10-windows_defender_exclusions-1.png

    2 Click/tap on the Manage settings link under Virus & threat protection settings. (see screenshot below)

    Add or Remove Microsoft Defender Antivirus Exclusions in Windows 10-windows_defender_exclusions-2.png

    3 Click/tap on the Add or remove exclusions link under Exclusions. (see screenshot below)

    Add or Remove Microsoft Defender Antivirus Exclusions in Windows 10-windows_defender_exclusions-3.png

    4 Click/tap on the Add an exclusion plus button, and do step 5 (file), step 6 (folder), step 7 (file type), or step 8 (process) below for what type of exclusion you want to add. (see screenshot below)

    Add or Remove Microsoft Defender Antivirus Exclusions in Windows 10-windows_defender_exclusions-4.png


    5 To Add a File Exclusion to Microsoft Defender Antivirus

    This option is to add a specific file as an exclusion to no longer be scanned by Windows Defender Antivirus.

    A) Click/tap on File under Add an exclusion. (see screenshot below step 4)

    B) Navigate to and select a file you want to exclude, click/tap on Open, and go to step 9 below. (see screenshot below)

    Add or Remove Microsoft Defender Antivirus Exclusions in Windows 10-windows_defender_file_exclusion.png


    6 To Add a Folder Exclusion to Microsoft Defender Antivirus

    This option is to add a folder as an exclusion to no longer have the folder and the files in the folder scanned by Microsoft Defender Antivirus.

    A) Click/tap on Folder under Add an exclusion. (see screenshot below step 4)

    B) Navigate to and select a folder you want to exclude, click/tap on Select folder, and go to step 9 below. (see screenshot below)

    Add or Remove Microsoft Defender Antivirus Exclusions in Windows 10-windows_defender_folder_exclusion.png


    7 To Add a File Type Exclusion to Microsoft Defender Antivirus

    This option is to add a file extension as an exclusion to no longer have all files with that file type scanned by Microsoft Defender Antivirus.

    A) Click/tap on File type under Add an exclusion. (see screenshot below step 4)

    B) Enter a file extension you want to exclude, click/tap on Add, and go to step 9 below. (see screenshot below)

    Add or Remove Microsoft Defender Antivirus Exclusions in Windows 10-windows_defender_file_type_exclusion.png


    8 To Add a Process Exclusion to Microsoft Defender Antivirus

    This option is to add a process as an exclusion to no longer have any file associated with it scanned by Microsoft Defender Antivirus.

    A) Click/tap on Process under Add an exclusion. (see screenshot below step 4)

    B) Enter a process name you want to exclude, click/tap on Add, and go to step 9 below. (see screenshot below)

    Add or Remove Microsoft Defender Antivirus Exclusions in Windows 10-windows_defender_process_exclusion.png

    9 Click/tap on Yes when prompted by UAC to approve.

    10 Repeat step 4 above if you would like to add another exclusion to Microsoft Defender.

    11 When finished, you can close Settings if you like.






    OPTION TWO

    To Remove an Exclusion from Microsoft Defender Antivirus in Windows Security


    1 Open Windows Security, and click/tap on the Virus & threat protection icon. (see screenshot below)

    Add or Remove Microsoft Defender Antivirus Exclusions in Windows 10-windows_defender_exclusions-1.png

    2 Click/tap on the Manage settings link under Virus & threat protection settings. (see screenshot below)

    Add or Remove Microsoft Defender Antivirus Exclusions in Windows 10-windows_defender_exclusions-2.png

    3 Click/tap on the Add or remove exclusions link under Exclusions. (see screenshot below)

    Add or Remove Microsoft Defender Antivirus Exclusions in Windows 10-windows_defender_exclusions-3.png

    4 Click/tap on an added exclusion that you want to remove, and click/tap on its Remove button. (see screenshot below)

    Add or Remove Microsoft Defender Antivirus Exclusions in Windows 10-windows_defender_remove_exclusions.png

    5 Click/tap on Yes when prompted by UAC to approve.

    6 Repeat step 4 above if you would like to remove another exclusion.

    7 When finished, you can close Settings if you like.






    OPTION THREE

    To Add or Remove File Exclusion for Microsoft Defender Antivirus in PowerShell


    This option is to add or remove a specific file as an exclusion to no longer be scanned by Microsoft Defender Antivirus.


    1 Open an elevated PowerShell.

    2 Type the command you want to use below into the elevated PowerShell, and press Enter. (see screenshots below)

    (Add file exclusion)
    Add-MpPreference -ExclusionPath "<Full path of file>" -Force

    OR

    (Remove file exclusion)
    Remove-MpPreference -ExclusionPath "<Full path of file>" -Force

    Substitute <Full path of file> in the commands above with the actual full path of the file (ex: "C:\Windows\notepad.exe") you want to add or remove as an exclusion.


    3 You can now close the elevated PowerShell if you like.

    Add or Remove Microsoft Defender Antivirus Exclusions in Windows 10-add_windows_defender_file_exclusion_powershell.png Add or Remove Microsoft Defender Antivirus Exclusions in Windows 10-remove_windows_defender_file_exclusion_powershell.png






    OPTION FOUR

    To Add or Remove Folder Exclusion for Microsoft Defender Antivirus in PowerShell


    This option is to add or remove a folder as an exclusion to no longer have the folder and the files in the folder scanned by Microsoft Defender Antivirus.


    1 Open an elevated PowerShell.

    2 Type the command you want to use below into the elevated PowerShell, and press Enter. (see screenshots below)

    (Add folder exclusion)
    Add-MpPreference -ExclusionPath "<Full path of folder>" -Force

    OR

    (Remove folder exclusion)
    Remove-MpPreference -ExclusionPath "<Full path of folder>" -Force

    Substitute <Full path of folder> in the commands above with the actual full path of the folder (ex: "C:\Users\Brink\Pictures") you want to add or remove as an exclusion.


    3 You can now close the elevated PowerShell if you like.

    Add or Remove Microsoft Defender Antivirus Exclusions in Windows 10-add_windows_defender_folder_exclusion_powershell.png Add or Remove Microsoft Defender Antivirus Exclusions in Windows 10-remove_windows_defender_folder_exclusion_powershell.png






    OPTION FIVE

    To Add or Remove File Type Exclusion for Microsoft Defender Antivirus in PowerShell


    This option is to add or remove a file extension as an exclusion to no longer have all files with that file type scanned by Microsoft Defender Antivirus.


    1 Open an elevated PowerShell.

    2 Type the command you want to use below into the elevated PowerShell, and press Enter. (see screenshots below)

    (Add file type exclusion)
    Add-MpPreference -ExclusionExtension "<File type extension>" -Force

    OR

    (Remove file type exclusion)
    Remove-MpPreference -ExclusionExtension "<File type extension>" -Force

    Substitute <File type extension> in the commands above with the actual file type extension (ex: ".jpg") you want to add or remove as an exclusion.


    3 You can now close the elevated PowerShell if you like.

    Add or Remove Microsoft Defender Antivirus Exclusions in Windows 10-add_windows_defender_file_type_exclusion_powershell.png Add or Remove Microsoft Defender Antivirus Exclusions in Windows 10-remove_windows_defender_file_type_exclusion_powershell.png






    OPTION SIX

    To Add or Remove Process Exclusion for Microsoft Defender Antivirus in PowerShell


    This option is to add or remove a process as an exclusion to no longer have any file associated with it scanned by Microsoft Defender Antivirus.


    1 Open an elevated PowerShell.

    2 Type the command you want to use below into the elevated PowerShell, and press Enter. (see screenshots below)

    (Add process exclusion)
    Add-MpPreference -ExclusionProcess "<Process name>" -Force

    OR

    (Remove process exclusion)
    Remove-MpPreference -ExclusionProcess "<Process name>" -Force

    Substitute <Process name> in the commands above with the actual process name (ex: "SecHealthUI.exe") you want to add or remove as an exclusion.


    3 You can now close the elevated PowerShell if you like.

    Add or Remove Microsoft Defender Antivirus Exclusions in Windows 10-add_windows_defender_process_exclusion_powershell.png Add or Remove Microsoft Defender Antivirus Exclusions in Windows 10-remove_windows_defender_process_exclusion_powershell.png


    That's it,
    Shawn Brink






  1. Posts : 56,939
    Multi-boot Windows 10/11 - RTM, RP, Beta, and Insider
       #1

    @Brink - Shawn, this is a good one to know, and I would add one thing. The "Why would I want to do this?".

    Files and folders (including whole external drives or partitions, etc.) may be obvious, but excluding a process may not be.

    The process you chose for this tutorial (MBAM) is a perfect example. Malwarebytes scanner is a well used and trusted anti-malware product. I cut the run time of a full scan using MBAM w/Def exclusion by about 50%... 18 mins to 9 mins. Windows Defender did did not have to monitor a trusted process. This can be seen by running Task Manager and monitoring the MsMpEng.exe.

    It would be wise to point out, though, to not take this option too far! Only use it in cases where you are comfortable and know the risk level is extremely low. Example: DO NOT add Spartan.exe as an exclusion!

    Thanks for the Tut!
      My Computers


  2. Posts : 70,904
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #2

    @f14tomcat

    Good point Dick. I added a note to the tutorial for that. :)
      My Computers


  3. Posts : 14
    7
       #3

    Would anyone know if path exclusion is recursive? Also is there a way to specify wildcards?
      My Computer


  4. Posts : 70,904
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #4

    Hello Biatche, :)

    If you exclude a "File location", then WD will exclude all files and subfolders on that location.

    I don't believe you can use wildcards, but if you add a "File type" exclusion, then all file types with that extension will be excluded.
      My Computers


  5. Posts : 39
    Windows 10
       #5

    Hello Brink,

    I was wondering if you can help me please.

    I have selected certain file types / folders and locations in Windows Defender on Windows 10 that were added to the exclusions lists...

    Previously I could go to Windows Defender and see what files, folders or extensions I had excluded but now they have disappeared....

    All I see is the add buttons which work as intended when I want to add a folder etc etc....
    But then they are not listed anywhere so that I can remember what I have excluded or not....

    Can some one please help me so that they are visible again, is there a setting in the registry that needs to be fixed?

    This is what I should see where, below the red arrows I should see the excluded files/folders including their path etc etc [see image below]

    but I see nothing..

    Yet if i go to the registry as indicated below...

    File and file location exclusions are stored in the registry key below.

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Defender\Exclusions\Paths

    File type exclusions are stored in the registry key below.

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Defender\Exclusions\Extensions

    Processes exclusions are stored in the registry key below.

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Defender\Exclusions\Processes

    they are all listed there....?

    I have to say that windows defender is excluding folders/files and etc etc, that I have selected during its scans, but I cant see the excluded items in the Windows Defender as per image of my Exclusions section below...



    Thanking you in advance for your support and assistance on this issue....

    Cheers
    Last edited by Brink; 29 Sep 2017 at 17:26.
      My Computer


  6. Posts : 70,904
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #6

    Hello Kokakola, :)

    The only way that I know of to add them back is to delete them in the registry, and manually add the exceptions back in Settings.

    I'd recommend to export the Exclusions key first to be able to use it as a reference to help add all of the exceptions back.
      My Computers


  7. Posts : 39
    Windows 10
       #7

    Brink said:
    Hello Kokakola, :)

    The only way that I know of to add them back is to delete them in the registry, and manually add the exceptions back in Settings.

    I'd recommend to export the Exclusions key first to be able to use it as a reference to help add all of the exceptions back.
    Hhello BRINK,

    I have already done that in the registry and re entered them again but they still refuse to show up in the section under exclusions... is it that the settings in the registry are set wrong?

    mine all have value not set? is this the issue...
      My Computer


  8. Posts : 70,904
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #8

    Just to verify, you re-entered them in Settings and not from the registry?

    Go ahead and restart the computer, and see if you are able to enter them in Settings and have them show.

    Please aslo post a screenshot showing what you see in Settings to see if it may reveal anything.
      My Computers


  9. Posts : 39
    Windows 10
       #9

    Brink said:
    Just to verify, you re-entered them in Settings and not from the registry?

    Go ahead and restart the computer, and see if you are able to enter them in Settings and have them show.

    Please aslo post a screenshot showing what you see in Settings to see if it may reveal anything.
    I have done as you advised but still no go...

    as you can see from the images attached i see the exclusions listed in the registry but they wont show up on windows defender...

    has it anything to do with the fact that the registry values are not set?
    as shown in the images attached...
    thanks in advance...
    Add or Remove Microsoft Defender Antivirus Exclusions in Windows 10-registry-windows-defender-exclusions-list.jpgAdd or Remove Microsoft Defender Antivirus Exclusions in Windows 10-windows-defender-exclusions-list.jpg
      My Computer


 

Tutorial Categories

Add or Remove Microsoft Defender Antivirus Exclusions in Windows 10 Tutorial Index Network & Sharing Instalation and Upgrade Browsers and Email General Tips Gaming Customization Apps and Features Virtualization BSOD System Security User Accounts Hardware and Drivers Updates and Activation Backup and Restore Performance and Maintenance Mixed Reality Phone


  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 20:59.
Find Us




Windows 10 Forums