Follow
Windows

How to Exclude Files from Microsoft Defender on Windows 11

Richard
Written by
Richard
Oct 24, 2021 Updated Apr 28, 2026 3 min read
How to Exclude Files from Microsoft Defender on Windows 11

Microsoft Defender is your computer’s built-in security guard. It constantly checks files to stop viruses. Sometimes, it slows down programs you trust, like game folders or coding tools. By using exclusions, you tell Defender to ignore specific items. This makes your computer run faster during heavy tasks.

What happens when you are done?

Once you add an exclusion, Defender stops scanning those files. This means if a virus hides in that folder, Defender will not see it. Only exclude files you know are safe. Always keep your exclusion list as short as possible to stay secure.

How to add exclusions in Windows 11

Note: You must have administrator privileges to change these settings.

1. Click the Start button and type Windows Security. Open the app.

Windows Security app open on Windows 11

2. Click Virus & threat protection. Then, click Manage settings.

Virus and threat protection settings in Windows Security

3. Scroll down and click Add or remove exclusions.

Adding an exclusion in Windows Security on Windows 11

4. Click the Add an exclusion button and choose File, Folder, File type, or Process.

Add an exclusion option in Windows Security app

5. Select your item and confirm the change.

Exclusion settings for Microsoft Defender on Windows 11

Comparison of Exclusion Methods

MethodBest ForDifficulty
Windows Security AppHome usersEasy
PowerShellAdvanced usersMedium
Intune/GPOIT AdministratorsHigh

Advanced Configuration and Enterprise Management

For businesses, manually adding exclusions is not efficient. Administrators use Configuration Manager or Intune to push policies to many computers at once. You can also use PowerShell to manage these settings quickly. For example, to add a folder exclusion via PowerShell, run this command as an administrator:

💻Code
Add-MpPreference -ExclusionPath "C:\Projects\Development"

You can also use wildcards to exclude entire groups of files. For example, using C:\Projects\*\bin will exclude the ‘bin’ folder inside every subfolder of your projects directory.

Validation and Verification

How do you know if your exclusion worked? You can check the current list using the command line. Open PowerShell as an administrator and type:

PowerShell
Get-MpPreference | Select-Object -ExpandProperty ExclusionPath

This command lists every path currently ignored by Defender. You can also use the MpCmdRun.exe tool located in C:\Program Files\Windows Defender\MpCmdRun.exe to perform manual scans and verify that your excluded files are being skipped during a scheduled scan.

Best Practices for Security

Exclusions are a security risk. Only use them when you notice a real performance problem. Avoid excluding entire drives like C:\ or common system folders. Always prefer file-specific exclusions over folder-wide exclusions to keep your system as safe as possible.

Summary

Excluding files from Microsoft Defender helps improve performance for trusted applications. You can manage these settings through the Windows Security app for simple tasks or use PowerShell for advanced control. Always remember that exclusions bypass security checks, so only add items you trust. Regularly review your exclusion list to ensure your computer remains protected.

Are exclusions safe for all file types?

No, exclusions are not inherently safe. When you exclude a file, you remove the security layer for that specific item. Only exclude files that you trust completely, such as your own source code or trusted game files, to minimize the risk of malware infection.

What is the difference between file and process exclusions?

A file exclusion tells Defender to ignore a specific file or folder on your hard drive. A process exclusion tells Defender to ignore everything a specific program does while it is running, such as ignoring all activity from a specific database engine.

Was this guide helpful?

Tags: #Windows 11
Richard

About the Author

Richard

Tech Writer, IT Professional

Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.

2482 articles → Twitter

📚 Related Tutorials

How to Check Microsoft Defender Updates in Windows 11
Windows How to Check Microsoft Defender Updates in Windows 11
How to Optimize Microsoft Defender CPU Usage in Windows 11
Windows How to Optimize Microsoft Defender CPU Usage in Windows 11
How to Enable or Disable Windows Security Notifications in Windows 11
Windows How to Enable or Disable Windows Security Notifications in Windows 11
How to Enable or Disable Microsoft Defender in Windows 11
Windows How to Enable or Disable Microsoft Defender in Windows 11

Leave a Reply

Your email address will not be published. Required fields are marked *