How to Add Exclusions in Windows Security

Windows Security includes Microsoft Defender Antivirus, which continuously scans files, folders, processes, and other areas of Windows to detect potential threats. This protection is useful for keeping your computer safe, but occasionally Defender may identify a legitimate file or application as a potential threat.

If you know that a particular file, folder, process, or application is safe, Windows 11 allows you to add it to the Microsoft Defender Antivirus exclusion list. An exclusion tells Defender not to scan the selected item in the same way it scans other files.

This feature can be useful for trusted development projects, applications that are incorrectly detected, or specific files that repeatedly trigger false-positive detections. However, exclusions reduce protection, so they should be used carefully and only for items you completely trust.

You can add exclusions directly through Windows Security. Windows also provides PowerShell commands for users who need to manage exclusions from the command line.

Method 1: Add a File Exclusion in Windows Security

If Microsoft Defender repeatedly flags a specific file that you know is safe, you can exclude that individual file.

  • Press Windows + S.
  • Type Windows Security.
  • Open the Windows Security app.
  • Click Virus & threat protection.
  • Under Virus & threat protection settings, click Manage settings.
  • Scroll down to Exclusions.
  • Click Add or remove exclusions.
  • Click Add an exclusion.
  • Select File.
  • Browse to the file you want to exclude.
  • Select the file.
  • Confirm your selection.

The selected file will now appear in the exclusions list.

A file-level exclusion is generally preferable to excluding an entire folder because it limits the scope of the change.

If the file is moved to another location, the exclusion may no longer apply because Defender exclusions are associated with the selected path.

Method 2: Exclude an Entire Folder

You can also exclude a folder if a trusted application or project contains many files that are repeatedly detected.

  • Open Windows Security.
  • Select Virus & threat protection.
  • Click Manage settings.
  • Scroll to Exclusions.
  • Click Add or remove exclusions.
  • Select Add an exclusion.
  • Choose Folder.
  • Browse to the folder you want to exclude.
  • Select the folder.
  • Confirm the selection.

Windows will add the folder to the Defender exclusion list.

All files within the selected folder may then be excluded from Microsoft Defender’s normal scanning behavior.

Because this can cover a large number of files, be careful when selecting the folder.

For example, excluding a dedicated folder containing a trusted development project may be reasonable. Excluding your entire Downloads folder, however, can unnecessarily reduce protection because files downloaded from the internet are commonly stored there.

Method 3: Exclude a Specific File Type

Windows Security can also exclude a particular file extension.

  • Open Windows Security.
  • Go to Virus & threat protection.
  • Select Manage settings.
  • Find Exclusions.
  • Click Add or remove exclusions.
  • Select Add an exclusion.
  • Choose File type.
  • Enter the file extension.
  • Confirm the exclusion.

Use this option with particular caution.

A file-type exclusion can apply to many files across the computer. If you exclude a commonly used executable or script format, potentially dangerous files with the same extension could escape normal antivirus scanning.

Whenever possible, use a specific file or folder exclusion instead of excluding an entire file type.

Method 4: Exclude a Process

Windows Security can also provide a process-based exclusion option.

  • Open Windows Security.
  • Select Virus & threat protection.
  • Click Manage settings.
  • Scroll down to Exclusions.
  • Click Add or remove exclusions.
  • Select Add an exclusion.
  • Choose Process.
  • Enter the process name.
  • Confirm the selection.

For example, a legitimate application may use a particular executable that repeatedly causes compatibility problems with antivirus scanning.

Before excluding a process, verify that the executable belongs to the trusted application.

Do not exclude a process simply because its name looks familiar. Malware can sometimes use names that resemble legitimate Windows processes.

If possible, verify the application’s installation location and digital signature before adding the process to the exclusion list.

Method 5: Add an Exclusion Using PowerShell

PowerShell provides another way to manage Microsoft Defender exclusions.

  • Press Windows + S.
  • Search for PowerShell.
  • Right-click PowerShell.
  • Select Run as administrator.
  • Enter a command appropriate for the exclusion you want to create.

For example, to exclude a folder:

Add-MpPreference -ExclusionPath "C:\TrustedFolder"

Replace the path with the folder you want to exclude.

To exclude a specific file:

Add-MpPreference -ExclusionPath "C:\TrustedFolder\example.exe"

To add a process exclusion:

Add-MpPreference -ExclusionProcess "example.exe"

PowerShell is useful when you need to configure Defender on multiple computers or incorporate the change into an administrative script.

Be careful when running these commands. An incorrect exclusion can weaken antivirus protection without producing an obvious warning that the affected files are no longer being scanned normally.

Method 6: View Existing Defender Exclusions

Before adding a new exclusion, it is useful to check what is already excluded.

You can view the list through Windows Security:

  • Open Windows Security.
  • Select Virus & threat protection.
  • Click Manage settings.
  • Scroll to Exclusions.
  • Select Add or remove exclusions.

Review every item displayed there.

You can also use PowerShell.

  • Open PowerShell as administrator.
  • Run:
Get-MpPreference | Select-Object -ExpandProperty ExclusionPath

To check excluded processes:

Get-MpPreference | Select-Object -ExpandProperty ExclusionProcess

To check excluded extensions:

Get-MpPreference | Select-Object -ExpandProperty ExclusionExtension

Reviewing existing exclusions can help explain why a particular file or folder is not being scanned as expected.

It is also a good way to identify old exclusions that are no longer necessary.

Method 7: Remove an Exclusion You No Longer Need

If you previously added an exclusion and no longer need it, remove it to restore normal Defender protection for that item.

From Windows Security:

  • Open Windows Security.
  • Click Virus & threat protection.
  • Select Manage settings.
  • Scroll down to Exclusions.
  • Click Add or remove exclusions.
  • Find the exclusion.
  • Click it.
  • Select Remove.

You can also remove exclusions through PowerShell.

For a folder or file path:

Remove-MpPreference -ExclusionPath "C:\TrustedFolder"

For a process:

Remove-MpPreference -ExclusionProcess "example.exe"

For a file extension:

Remove-MpPreference -ExclusionExtension ".example"

Use the exact value that was previously added.

After removing an unnecessary exclusion, Microsoft Defender can again apply its normal scanning behavior to that location or item.

Method 8: Choose the Smallest Possible Exclusion

The safest way to use Defender exclusions is to keep them as narrow as possible.

Suppose a single trusted executable is repeatedly detected.

Instead of excluding:

C:\

or:

C:\Users

exclude only the required file or application location.

For example:

C:\Program Files\ExampleApp\example.exe

Similarly, if an application needs access to a dedicated project directory, exclude that project folder rather than an entire drive.

Before adding an exclusion, ask:

  • Is the file definitely trustworthy?
  • Can I use a file exclusion instead of a folder exclusion?
  • Can I avoid excluding an entire file type?
  • Is the exclusion still necessary?
  • Is the file stored in a location where untrusted files could later be added?

The narrower the exclusion, the less Microsoft’s antivirus protection is reduced.

Conclusion

Windows 11 makes it possible to exclude trusted files, folders, file types, and processes from Microsoft Defender Antivirus scanning. The feature can be useful when a legitimate application or file produces a false positive or when a trusted workload conflicts with antivirus scanning.

The easiest way to manage exclusions is through Windows Security > Virus & threat protection > Manage settings > Add or remove exclusions. Advanced users can also use PowerShell commands such as Add-MpPreference and Remove-MpPreference.

However, exclusions should not be used casually. An excluded location receives less protection from Microsoft Defender, so malicious files placed there may be able to avoid normal antivirus scanning.

Whenever possible, exclude the smallest possible item. A single trusted file is preferable to an entire folder, and a specific folder is generally preferable to excluding a broad file type or an entire drive.

Review your exclusion list periodically and remove entries that are no longer required.

FAQs

1. Is it safe to add exclusions in Windows Security?

Adding an exclusion is safe when you completely trust the item being excluded, but it reduces Microsoft’s Defender scanning coverage for that item. Never exclude a file simply because an antivirus warning is inconvenient.

2. Can I exclude an entire drive from Microsoft Defender?

Windows can support broad exclusion paths, but excluding an entire drive is generally a poor security practice unless there is a specific and well-understood administrative reason. Use the smallest possible exclusion instead.

3. Why is my Windows Security exclusion not working?

Check that you selected the correct file, folder, process, or extension and that the exclusion is still listed under Add or remove exclusions. Also verify that the application is actually being detected by Microsoft Defender rather than another security product.

4. How do I remove a Windows Defender exclusion?

Open Windows Security > Virus & threat protection > Manage settings > Add or remove exclusions, select the exclusion, and click Remove. You can also use the corresponding Remove-MpPreference PowerShell command.

Quick Summary

  • Use Windows Security to add file, folder, process, or file-type exclusions.
  • PowerShell can manage exclusions with Add-MpPreference and Remove-MpPreference.
  • Use the narrowest possible exclusion to minimize the reduction in antivirus protection.
  • Review and remove old exclusions that are no longer necessary.

Related Articles

Popular Categories