To add an exception (Microsoft calls it an exclusion) to Windows Defender, open Windows Security, select Virus & threat protection, and under Virus & threat protection settings select Manage settings. Scroll to Exclusions, select Add or remove exclusions, approve the administrator prompt, then select Add an exclusion, choose File, Folder, File type or Process, and pick the item. The steps match in Windows 11 and Windows 10.
Is an exclusion the right fix?
The antivirus once called Windows Defender is now Microsoft Defender Antivirus, and you manage it in the Windows Security app. An exclusion tells it to skip a file, folder, file type or process when it scans. Microsoft’s own documentation calls every exclusion a protection gap and says you usually don’t need one at all.
An exclusion makes sense in a narrow set of cases:
- Defender keeps flagging a program you got from its official developer and you’ve confirmed the detection is a mistake (a false positive).
- A trusted tool, such as a backup program or software your employer provides, is slowed down or broken because Defender keeps scanning the files it works with.
- Your IT department or the software’s developer has told you exactly which folder or process to exclude, and why.
It isn’t the right fix in these cases, and Microsoft’s warnings apply in full:
- You aren’t sure the file is safe. Scan it first (right-click it and choose Scan with Microsoft Defender) or send it to Microsoft for analysis, as described below. Excluding a file never makes it safe; it only stops Defender checking it.
- The file is cracked, pirated or a “keygen,” cheat or patch. These are a common way malware gets onto PCs, and Defender is often correct about them. Don’t exclude them, and delete them.
- Someone online or on the phone told you to add an exclusion. Scammers ask for this so their software can run unchecked. Say no.
Warning: never exclude a whole drive (such as C:), the Windows folder, Program Files, your Downloads, Desktop or Documents folders, a temp folder, or a broad file type such as .exe, .dll or .zip. Any of those turns off scanning for a huge share of what malware uses. Always choose the narrowest exclusion that solves the problem: one file is better than a folder, and a small dedicated folder is better than a big shared one.
Add an exclusion in Windows Security
You need to be signed in with an administrator account, or know an administrator’s PIN or password, because Windows asks for approval before it changes the list.
- Open Windows Security. Select Start, type Windows Security, and open the app. (On Windows 10 you can also go to Start > Settings > Update & Security > Windows Security > Open Windows Security; on Windows 11, Start > Settings > Privacy & security > Windows Security.)
- Select Virus & threat protection in the left menu or on the home page.
- Select Manage settings under the Virus & threat protection settings heading. This page also holds the Real-time protection switch.
- Scroll to Exclusions near the bottom of the page and select Add or remove exclusions.
- Approve the prompt. When User Account Control asks whether to allow the app to make changes, select Yes (or enter an administrator’s credentials).
- Select Add an exclusion (the button with a plus sign) and choose File, Folder, File type or Process. The next section explains which to pick.
- Choose the item. For File or Folder, a browse window opens: go to the item, select it, then select Open or Select Folder. For File type, type the extension (for example, .xyzproj) and select Add. For Process, type the full path and program name and select Add.
- Check the list. The new entry appears under Add an exclusion with its full path or extension. If it doesn’t, repeat steps 6 and 7.
There’s no Save button: once the entry shows in the list, it’s in place, and you don’t need to restart.
Which exclusion type to choose
| Type | What it skips | Example of a sensible use |
|---|---|---|
| File | One specific file at one location | A single in-house tool that Defender wrongly flags, after you’ve reported it |
| Folder | That folder and all the files inside it | A dedicated folder where a trusted backup program writes large archive files |
| File type | Every file with that extension, anywhere on the PC | Rarely sensible for home users; only for an unusual extension one trusted app creates |
| Process | Files opened by that program (in real-time scanning); the program file itself isn’t excluded | A trusted program that reads thousands of files, when your IT department or the developer recommends it |
For example, if Priya’s accounting app keeps its data in C:\AcctData and Defender’s scanning slows every save, a folder exclusion for C:\AcctData is far narrower than excluding all of Documents. If Jordan’s one utility keeps getting flagged, a File exclusion for that one .exe (after reporting it to Microsoft) beats excluding its whole folder.
Two details trip people up. A file type exclusion applies everywhere on the PC, which is why it’s the riskiest choice. And a process exclusion doesn’t cover the program’s own file; Microsoft recommends entering the process by its full path and file name so you exclude only that exact program.
If Defender already blocked or quarantined the file
An exclusion only affects future scans. If Defender has already removed or quarantined something you’re sure is safe, deal with that first in Protection history:
- In Windows Security, select Virus & threat protection and then Protection history. You need administrator rights to see the details.
- Select the entry for your file to expand it and read the details: the detection name, the file path and the action taken.
- For a quarantined item, open Actions and choose Restore. The file goes back where it was, and Defender shows a new “Threat found – action needed” card for it.
- On that card, choose Allow on device only if you’re confident the file is safe. Microsoft’s advice is that if you’re not sure, choose Quarantine.
If the card says Threat blocked, the file is already gone. Choosing Allow applies only the next time Defender sees that file, so you’ll need to download it again from the official source. To undo an allow later, open the Allowed threats list on the Virus & threat protection page and remove the item.
Report a false positive to Microsoft
If a legitimate program is being flagged, reporting it is better than living with an exclusion, because a fix from Microsoft protects you without a gap. Use Microsoft’s file submission page, choose Home customer, upload the file (up to 50 MB), and select Incorrectly detected as malware/malicious. Signing in with a Microsoft account is optional but lets you track the result. Developers of the software can also submit it themselves, so it’s worth telling them too.
What an exclusion doesn’t change
- It’s about real-time scanning. Microsoft’s Windows Security help says exclusions apply to real-time scanning and that scheduled scans might still check those files. Don’t be surprised if a full scan mentions an excluded item.
- Other protections are separate. SmartScreen warnings when you open a downloaded app, Controlled folder access (ransomware protection) blocking an app from changing your folders, and Windows Firewall blocking network access each have their own settings. For a trusted app that Controlled folder access stops, use Manage ransomware protection > Allow an app through Controlled folder access instead of an exclusion.
- Another antivirus takes over. If you install a compatible antivirus from another company, Microsoft Defender Antivirus turns itself off. In that case, add exceptions in the other product, not in Windows Security.
- It doesn’t follow you. Exclusions added in Windows Security apply only to that PC.
Review or remove an exclusion
Exclusions stay in place until you remove them; they don’t expire. Check the list every few months, and whenever you uninstall the program it was for, because an exclusion for software you no longer use is a gap with no benefit.
- Go to Windows Security > Virus & threat protection > Manage settings > Add or remove exclusions, and approve the prompt.
- Select the exclusion you want to delete. It expands to show a Remove button.
- Select Remove. The entry disappears and Defender scans that item normally again.
When you can’t add or change exclusions
- No administrator rights. On a standard account, the Add or remove exclusions page needs an administrator to approve it. Ask the person who manages the PC.
- “This setting is managed by your administrator.” On a work or school PC, exclusions are set by your organization’s policies, and those take precedence over local changes. Contact your IT department; don’t try to work around it.
- A network folder. Microsoft advises against excluding mapped network drives (such as Z:). Use the full network path (for example, \\server\share\folder) instead.
- The exclusion “doesn’t work.” Check the path matches exactly, including the drive letter, and that the program didn’t move after an update. If Defender is still blocking the item, the block may come from SmartScreen, Controlled folder access or a scheduled scan instead.
For administrators: the PowerShell equivalent
In PowerShell opened with Run as administrator, Add-MpPreference -ExclusionPath “C:\AcctData” adds a folder exclusion, and Remove-MpPreference -ExclusionPath “C:\AcctData” removes it. Get-MpPreference shows the current settings. Avoid Set-MpPreference for this, because Microsoft notes it overwrites existing exclusions of the same type. The same narrow-scope rules apply.
Common questions about Defender exclusions
Can I exclude a website instead of a file?
No. Defender’s exclusion list covers files, folders, file types and processes only. A warning about a website comes from SmartScreen or your browser, and it has its own controls.
Is turning off real-time protection a better option?
Almost never. Switching off protection affects every file on the PC, while an exclusion affects one item. If you truly need scanning paused for a few minutes, you can turn off antivirus in Windows 11 temporarily and it switches back on by itself; the same switch is covered in these steps for turning off Windows Defender temporarily on either version.
What if Defender is off completely on Windows 10?
Exclusions do nothing if Defender isn’t your active antivirus. Check the top of the Virus & threat protection page, and if nothing is protecting the PC, turn on Windows Defender in Windows 10 before you change anything else. Microsoft explains every switch on this page in its virus and threat protection help.
If you’ve just added an exclusion, write down what it’s for, so the next time you review the list you’ll know whether it can go.
Matthew Burleigh has been a freelance writer since the early 2000s. You can find his writing all over the Web, where his content has collectively been read millions of times.
Matthew received his Master’s degree in Computer Science, then spent over a decade as an IT consultant for small businesses before focusing on writing and website creation.
The topics he covers for MasterYourTech.com include iPhones, Microsoft Office, and Google Apps.
You can read his full bio here.