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:
- Add an exclusion to Windows Security
- How to add a file type or process exclusion to Windows Security
- Configure and validate exclusions for Microsoft Defender Antivirus scans
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
1 Open Windows Security, and click/tap on the Virus & threat protection icon. (see screenshot below)
2 Click/tap on the Manage settings link under Virus & threat protection settings. (see screenshot below)
3 Click/tap on the Add or remove exclusions link under Exclusions. (see screenshot below)
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)
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)
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)
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)
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)
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.
1 Open Windows Security, and click/tap on the Virus & threat protection icon. (see screenshot below)
2 Click/tap on the Manage settings link under Virus & threat protection settings. (see screenshot below)
3 Click/tap on the Add or remove exclusions link under Exclusions. (see screenshot below)
4 Click/tap on an added exclusion that you want to remove, and click/tap on its Remove button. (see screenshot below)
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.
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.
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.
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.
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.
That's it,
Shawn Brink
Related Tutorials
- How to Create a Windows Defender Antivirus Shortcut in Windows 10
- How to Turn On or Off Microsoft Defender Antivirus in Windows 10
- How to Enable or Disable Real-time Protection for Microsoft Defender Antivirus in Windows 10
- How to Enable or Disable Windows Defender Block at First Sight in Windows 10
- How to Create a Windows Defender Settings shortcut in Windows 10
- How to Add or Remove Microsoft Defender context menu in Windows 10
- How to Hide or Show Windows Defender Notification Area Icon in Windows 10
- How to Add or Remove 'Scan with Microsoft Defender' Context Menu in Windows 10
- How to Enable or Disable Scan Archive Files by Windows Defender in Windows 10
- Enable or Disable Scan Mapped Network Drives with Windows Defender in Windows 10
- Enable or Disable Scan Removable Drives during Windows Defender Full Scan in Windows 10
- How to Manually Scan Files, Folders, and Drives with Windows Defender in Windows 10
- Hide or Show Virus and Threat Protection in Windows Defender Security Center in Windows 10
- How to Turn On or Off Windows Defender Block Suspicious Behaviors in Windows 10
- How to Enable or Disable Scan Network Files with Windows Defender Antivirus in Windows 10