Windows Security will scan files you add to its exclusion list and leave them alone
Windows Security (also called Windows Defender) scans files on your computer to catch viruses and malware. Sometimes it flags files you know are safe — a program you wrote yourself, a file from a trusted source, or something that triggers a false alarm. You can tell Windows Security to stop scanning specific files or folders by adding them to the exclusion list. Windows will skip those files during scans and won't interrupt you when you open them.
The exclusion list is permanent until you remove something from it, so use it only for files you genuinely trust. Once you exclude a file, Windows Security treats it as safe no matter what it contains, so a real threat hidden in an excluded folder will not be caught.
Key Takeaways
- You add files or folders to Windows Security's exclusion list through Settings, not through the Windows Security app itself.
- Excluded files are never scanned, so only exclude files from sources you completely trust.
- You can exclude individual files, entire folders, file types by extension, or running processes.
- Changes take effect when ready, and you can remove exclusions the same way you added them.
How to exclude a file or folder in Windows 11
Open the Settings app (press the Windows key and type "settings", then press Enter). Click Privacy & security in the left sidebar, then scroll down and click Virus & threat protection.
Click Manage settings under "Virus & threat protection settings". Scroll down to Exclusions and click Add or remove exclusions. Click the plus sign next to Add an exclusion, then choose whether you want to exclude a file, folder, file type, or process.
If you choose File, a window opens showing your folders. Navigate to the file you want to exclude and click it, then click Open. If you choose Folder, navigate to the folder and click Select Folder. The exclusion appears in the list when ready and takes effect right away.
How to exclude a file or folder in Windows 10
Open the Windows Security app (press the Windows key and type "windows security", then press Enter). Click Virus & threat protection in the left sidebar.
Scroll down to Virus & threat protection settings and click Manage settings. Scroll down to Exclusions and click Add or remove exclusions. Click the plus sign, choose whether you want to exclude a file, folder, file type, or process, then navigate to what you want to exclude and confirm.
Excluding by file type instead of individual files
If you want Windows Security to ignore all files with a certain extension — for example, all .exe files or all .zip files — you can exclude by file type instead of picking individual files. This is faster if you have many files of the same type, but it also means Windows will never scan any file with that extension, even new ones you read.
In the exclusion settings, click the plus sign and choose File type. Type the extension without the dot (for example, type exe or zip). Windows will exclude every file with that extension from scanning.
Excluding a running program
If a program you use regularly keeps getting blocked or slowed down by Windows Security scans, you can exclude the program's process. This tells Windows Security not to scan the program while it is running.
In the exclusion settings, click the plus sign and choose Process. Type the exact name of the program's executable file — for example, chrome.exe for Google Chrome or python.exe for Python. You can find the executable name by right-clicking the program's shortcut, clicking Properties, then clicking Open file location. The file shown is the one you want to exclude.
Removing an exclusion
If you change your mind about excluding a file or folder, you can remove it from the list. Open Settings, go to Privacy & security > Virus & threat protection > Manage settings > Add or remove exclusions. Find the exclusion you want to remove in the list and click the X next to it. Windows Security will start scanning that file or folder again when ready.
You should remove exclusions for files you no longer use or trust. The longer your exclusion list, the more files Windows Security skips, which means threats hidden in those files could go undetected.
When to use exclusions and when not to
Exclusions are useful for files that trigger false alarms — a program you compiled yourself, a script you wrote, or a file from a trusted developer that Windows Security keeps blocking. They are also reasonable for performance-critical programs that run constantly, since scanning them repeatedly can slow your system down.
Do not exclude files from unknown sources, files you downloaded from untrusted websites, or anything you are not sure about. Do not exclude entire system folders like Windows or Program Files unless you have a specific reason and understand the risk. If you are unsure whether a file is safe, run it through VirusTotal (virustotal.com) — upload the file and multiple antivirus engines will scan it for free. If most of them flag it, do not exclude it.
Frequently Asked Questions
Will excluding a file make Windows Security stop warning me about it?
Yes. Once a file is on the exclusion list, Windows Security will not scan it, flag it, or warn you about it. The file is treated as safe permanently until you remove it from the list.
Can I exclude a folder that contains subfolders?
Yes. When you exclude a folder, Windows Security excludes everything inside it, including all subfolders and files. This is useful if you have a project folder with many files you trust, but be careful — any new files added to that folder will also be excluded.
What happens if I exclude a file that actually contains malware?
Windows Security will not scan it or stop you from opening it. The malware can run freely. This is why you should only exclude files you are certain are safe. If you are wrong, your computer could be infected.
Do I need to restart my computer after adding an exclusion?
No. Exclusions take effect when ready. You do not need to restart Windows Security or your computer.
Can I exclude a file on an external drive or network location?
Yes, but the exclusion only works when that drive or location is connected. If you disconnect the external drive, the exclusion does not explore to other copies of the file elsewhere on your computer.