Windows Defender is an excellent built-in antivirus that constantly scans your computer for threats. However, if you are a software developer writing complex code, or a PC gamer using modding tools, Defender’s aggressive real-time scanning can sometimes incorrectly flag your safe files as malware, deleting them without warning. To stop this false-positive behaviour, you can exclude specific folders from being scanned.
How to Add an Exclusion
Adding an exclusion tells Windows Defender to completely ignore a specific file, folder, or even an entire hard drive.
- Open the Start Menu, type
Windows Security, and press Enter to open the app. - In the left-hand sidebar, click on Virus & threat protection.
- Scroll down to the “Virus & threat protection settings” section and click the blue Manage settings link.
- Scroll all the way down to the very bottom of the page until you see the “Exclusions” section.
- Click the blue Add or remove exclusions link. (You will be prompted by User Account Control to click Yes).
- Click the + Add an exclusion button.
- A dropdown menu will appear. Select Folder.
- A standard File Explorer window will open. Navigate to the specific folder that contains your coding projects or game mods, select it, and click Select Folder.
The folder path will now appear in your exclusions list. From this point forward, Windows Defender will completely ignore the contents of that folder during both real-time monitoring and scheduled background scans. Note: Only exclude folders that you trust absolutely, as any actual malware placed in this folder will also be ignored.