Privacy and Security Add or Remove Exclusions for Microsoft Defender Antivirus in Windows 11

  • Thread starter Thread starter Brink
  • Start date Published: Start date Updated Updated:
  • Tags Tags
    defender

Windows_Security_banner.png

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

Windows Security is built-in to Windows 11 and includes an antivirus program called Microsoft Defender Antivirus. Your device will be actively protected from the moment you start Windows 11. Windows Security continually scans for malware (malicious software), viruses, and security threats. In addition to this real-time protection, updates are downloaded automatically to help keep your device safe and protect it from threats.

If you trust a file, file type, folder, or a process that Windows Security has detected as malicious, you can stop Windows Security from alerting you or blocking the program by adding the file to the exclusions list.

References:


You must be signed in as an administrator 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


Only add exclusions for files that you are confident are safe. Adding an exclusion for an unsafe program could expose your systems and data to increased risk since they will no longer be scanned by Microsoft Defender Antivirus.



Contents

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




Option One

Add Exclusions to Microsoft Defender Antivirus in Windows Security


1 Open Windows Security.

2 Click/tap on Virus & threat protection in Windows Security. (see screenshot below)

Windows_Security-1.png

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

Windows_Security-2.png

4 Click/tap on the Add or remove exclusions link under Virus & threat protection settings. (see screenshot below)

Windows_Security-3.png

5 If prompted by UAC, click/tap on Yes.

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

Windows_Security_add_exclusions-1.png

7 Add File Exclusion to Microsoft Defender Antivirus in Windows Security

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 in the Add an exclusion drop menu. (see screenshot below step 6)​

B) Navigate to and select a file (ex: "notepad.exe") you want to exclude, click/tap on Open, and go to step 11 below. (see screenshot below)​

Windows_Security_add_exclusions-2.png

8 Add Folder Exclusion to Microsoft Defender Antivirus in Windows Security

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


A) Click/tap on Folder in the Add an exclusion drop menu. (see screenshot below step 6)​

B) Navigate to and select a folder (ex: "Pictures") you want to exclude, click/tap on Select Folder, and go to step 11 below. (see screenshot below)​

Windows_Security_add_exclusions-3.png

9 Add File Type Exclusion to Microsoft Defender Antivirus in Windows Security

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


A) Click/tap on File type in the Add an exclusion drop menu. (see screenshot below step 6)​

B) Type a file extension (ex: ".jpg") you want to exclude, click/tap on Add, and go to step 11 below. (see screenshot below)​

Windows_Security_add_exclusions-4.png

10 Add Process Exclusion to Microsoft Defender Antivirus in Windows Security

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


A) Click/tap on Process in the Add an exclusion drop menu. (see screenshot below step 6)​

B) Type a process name (ex: "SecHealthUI.exe") you want to exclude, click/tap on Add, and go to step 11 below. (see screenshot below)​

Windows_Security_add_exclusions-5.png

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




Option Two

Remove Exclusions from Microsoft Defender Antivirus in Windows Security


1 Open Windows Security.

2 Click/tap on Virus & threat protection in Windows Security. (see screenshot below)

Windows_Security-1.png

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

Windows_Security-2.png

4 Click/tap on the Add or remove exclusions link under Virus & threat protection settings. (see screenshot below)

Windows_Security-3.png

5 If prompted by UAC, click/tap on Yes.

6 Click/tap on an added extension you want to remove to expand it open. (see screenshot below)

7 Click/tap on Remove.

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

Windows_Security_remove_exclusions.png





Option Three

Add or Remove File Exclusion for Microsoft Defender Antivirus in PowerShell



1 Open Windows Terminal (Admin), and select Windows PowerShell.

2 Type the command you want to use below into Windows Terminal (Admin), and press Enter.

(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.

For example:
Add-MpPreference -ExclusionPath "C:\Windows\notepad.exe" -Force

Remove-MpPreference -ExclusionPath "C:\Windows\notepad.exe" -Force


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




Option Four

Add or Remove Folder Exclusion for Microsoft Defender Antivirus in PowerShell



1 Open Windows Terminal (Admin), and select Windows PowerShell.

2 Type the command you want to use below into Windows Terminal (Admin), and press Enter.

(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.

For example:
Add-MpPreference -ExclusionPath "C:\Users\Brink\Pictures" -Force

Remove-MpPreference -ExclusionPath "C:\Users\Brink\Pictures" -Force


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




Option Five

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



1 Open Windows Terminal (Admin), and select Windows PowerShell.

2 Type the command you want to use below into Windows Terminal (Admin), and press Enter.

(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.

For example:
Add-MpPreference -ExclusionExtension ".jpg" -Force

Remove-MpPreference -ExclusionExtension ".jpg" -Force


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




Option Six

Add or Remove Process Exclusion for Microsoft Defender Antivirus in PowerShell



1 Open Windows Terminal (Admin), and select Windows PowerShell.

2 Type the command you want to use below into Windows Terminal (Admin), and press Enter.

(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.

For example:
Add-MpPreference -ExclusionProcess "SecHealthUI.exe" -Force

Remove-MpPreference -ExclusionProcess "SecHealthUI.exe" -Force


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


That's it,
Shawn Brink
 
Last edited:
Is there a limit to the number of exclusions?

I'm trying to add one and it's just not working. "I:\Games Files". It ignores me and does not add anything.

I just added one yesterday "I:\Games" and it worked fine.
 

My Computers

System One System Two

  • OS
    Windroid 11 Pro
    Computer type
    PC/Desktop
    Manufacturer/Model
    MSI
    CPU
    Intel Core i9-14900K Raptor Lake Refreshed 6.0 GHZ
    Motherboard
    MSI MAG Z790 Tomahawk WiFi
    Memory
    32GB (2x16) GSKILL Trident Z5 RGB Series (Intel XMP 3.0) DDR5 RAM 6700MT/s
    Graphics Card(s)
    MSI Gaming GeForce RTX 4070 12GB
    Sound Card
    Onboard Realtek® ALC4080 Codec
    Monitor(s) Displays
    Monitor #1 Samsung Odyssey G50A WQHD G-Sync HDR10 Monitor #2 HP LA1911
    Screen Resolution
    2560x1440 and 1280x1024
    Hard Drives
    Samsung 980 PRO SSD 1TB PCIe 4.0 NVMe Gen 4 Gaming M.2 (150GB System / 850GB More Games)
    Crucial CT2000MX500SSD1 2TB (Games)
    Western Digital Green WD40EZRX 4TB (Data/Backup)
    Western Digital Blue WD60EZAZ 6TB (Storage)
    Western Digital Blue WD60EZAZ 6TB (Media)
    PSU
    Rosewill Hive-750S
    Case
    Cooler Master Elite 430 Mid Tower
    Cooling
    Cooler Master ML240L V2 Liquid CPU cooler + 3x120mm in + Isolated PSU Standard upward flow
    Keyboard
    Microsoft Natural Elite White PS/2 (with usb adapter)
    Mouse
    Microsoft D67-00001 Trackball Optical Mouse (rebuilt with ceramic bearings)
    Internet Speed
    450Mb/s hard wired
    Browser
    Edge, FF, Tor
    Antivirus
    Win Def
    Other Info
    Razer Tartarus V2 Gaming Keypad
    Logitech Z-5500 5.1 THX 505w (Orignal 10" Sub with (Fr, Rr, Ctr) Polk Audio satellites
  • Operating System
    Windows 11 Pro
    Computer type
    PC/Desktop
    Manufacturer/Model
    MSI
    CPU
    Intel Core i9-14900K Raptor Lake Refreshed 6.0 GHz FCLGA1700 (Gen 14)
    Motherboard
    MSI MAG Z790 Tomahawk WiFi
    Memory
    32GB (2x16) GSKILL Trident Z5 RGB Series (Intel XMP 3.0) DDR5 RAM 6700MT/s
    Graphics card(s)
    MSI Gaming GeForce RTX 3060Ti 8GB
    Sound Card
    Onboard Realtek® ALC4080 Codec
    Monitor(s) Displays
    Monitor #1 Samsung Odyssey G50A WQHD G-Sync HDR10 Monitor #2 Samsung TU7000 55" TV
    Screen Resolution
    2560x1440 and 3840x2160
    Hard Drives
    Samsung 980 PRO SSD 1TB PCIe 4.0 NVMe Gen 4 Gaming M.2 (System)
    Samsung 980 PRO SSD 2TB PCIe 4.0 NVMe Gen 4 Gaming M.2 (Games)
    Crucial CT1000MX500SSD1 1TB (More Games)
    WD Green WD20EZRX 2TB (Data/Backup)
    WD Blue WD60EZAZ 6TB (Media)
    PSU
    Rosewill Hive-750S
    Case
    Cooler Master N400 NSE-400-KKN2 Mid-Tower
    Cooling
    Cooler Master ML240L V2 Liquid CPU cooler + 3x120mm in + 2x120mm + Isolated PSU Reverse flow front exhaust
    Mouse
    MSI G20 Elite and Logitech MK345 Wireless
    Keyboard
    Logitech MK345 Wireless
    Internet Speed
    350Mb/s hard wired
    Browser
    FF
    Antivirus
    Win Def
    Other Info
    Razer Tartarus Gaming Keypad
    MSI GC30 Gaming Controller (Xbox style)
Is there a limit to the number of exclusions?

I'm trying to add one and it's just not working. "I:\Games Files". It ignores me and does not add anything.

I just added one yesterday "I:\Games" and it worked fine.

Figured it out. The scrollbar on the right wasn't appearing. The exclusion was added I just could not see it.

I created and added a new folder. When I did so the scroll bar appeared. Then I could scroll down and see both new exclusions were there.

Note: My display scale is at 100% so a custom scale did not cause it.
 

My Computers

System One System Two

  • OS
    Windroid 11 Pro
    Computer type
    PC/Desktop
    Manufacturer/Model
    MSI
    CPU
    Intel Core i9-14900K Raptor Lake Refreshed 6.0 GHZ
    Motherboard
    MSI MAG Z790 Tomahawk WiFi
    Memory
    32GB (2x16) GSKILL Trident Z5 RGB Series (Intel XMP 3.0) DDR5 RAM 6700MT/s
    Graphics Card(s)
    MSI Gaming GeForce RTX 4070 12GB
    Sound Card
    Onboard Realtek® ALC4080 Codec
    Monitor(s) Displays
    Monitor #1 Samsung Odyssey G50A WQHD G-Sync HDR10 Monitor #2 HP LA1911
    Screen Resolution
    2560x1440 and 1280x1024
    Hard Drives
    Samsung 980 PRO SSD 1TB PCIe 4.0 NVMe Gen 4 Gaming M.2 (150GB System / 850GB More Games)
    Crucial CT2000MX500SSD1 2TB (Games)
    Western Digital Green WD40EZRX 4TB (Data/Backup)
    Western Digital Blue WD60EZAZ 6TB (Storage)
    Western Digital Blue WD60EZAZ 6TB (Media)
    PSU
    Rosewill Hive-750S
    Case
    Cooler Master Elite 430 Mid Tower
    Cooling
    Cooler Master ML240L V2 Liquid CPU cooler + 3x120mm in + Isolated PSU Standard upward flow
    Keyboard
    Microsoft Natural Elite White PS/2 (with usb adapter)
    Mouse
    Microsoft D67-00001 Trackball Optical Mouse (rebuilt with ceramic bearings)
    Internet Speed
    450Mb/s hard wired
    Browser
    Edge, FF, Tor
    Antivirus
    Win Def
    Other Info
    Razer Tartarus V2 Gaming Keypad
    Logitech Z-5500 5.1 THX 505w (Orignal 10" Sub with (Fr, Rr, Ctr) Polk Audio satellites
  • Operating System
    Windows 11 Pro
    Computer type
    PC/Desktop
    Manufacturer/Model
    MSI
    CPU
    Intel Core i9-14900K Raptor Lake Refreshed 6.0 GHz FCLGA1700 (Gen 14)
    Motherboard
    MSI MAG Z790 Tomahawk WiFi
    Memory
    32GB (2x16) GSKILL Trident Z5 RGB Series (Intel XMP 3.0) DDR5 RAM 6700MT/s
    Graphics card(s)
    MSI Gaming GeForce RTX 3060Ti 8GB
    Sound Card
    Onboard Realtek® ALC4080 Codec
    Monitor(s) Displays
    Monitor #1 Samsung Odyssey G50A WQHD G-Sync HDR10 Monitor #2 Samsung TU7000 55" TV
    Screen Resolution
    2560x1440 and 3840x2160
    Hard Drives
    Samsung 980 PRO SSD 1TB PCIe 4.0 NVMe Gen 4 Gaming M.2 (System)
    Samsung 980 PRO SSD 2TB PCIe 4.0 NVMe Gen 4 Gaming M.2 (Games)
    Crucial CT1000MX500SSD1 1TB (More Games)
    WD Green WD20EZRX 2TB (Data/Backup)
    WD Blue WD60EZAZ 6TB (Media)
    PSU
    Rosewill Hive-750S
    Case
    Cooler Master N400 NSE-400-KKN2 Mid-Tower
    Cooling
    Cooler Master ML240L V2 Liquid CPU cooler + 3x120mm in + 2x120mm + Isolated PSU Reverse flow front exhaust
    Mouse
    MSI G20 Elite and Logitech MK345 Wireless
    Keyboard
    Logitech MK345 Wireless
    Internet Speed
    350Mb/s hard wired
    Browser
    FF
    Antivirus
    Win Def
    Other Info
    Razer Tartarus Gaming Keypad
    MSI GC30 Gaming Controller (Xbox style)

Latest Support Threads

Latest Tutorials

Back
Top Bottom