How to Add File, Folder, and App Exclusions in Windows Defender

Published 2026-10-16 · Marion Remote Fix

Windows Defender (Microsoft Defender Antivirus) is blocking a file, program, or folder that you know is safe — it quarantines a program you downloaded, flags a game mod as malware, slows down a developer tool by scanning its files, or prevents a legitimate application from running. You do not want to turn off Defender entirely, but you need it to stop interfering with specific files or programs. The solution is to add an exclusion. Here is how to do it safely.

When to add an exclusion

Before adding an exclusion, make sure the file is genuinely safe. Adding an exclusion tells Defender to completely ignore that file, folder, or process — if it actually is malware, Defender will not protect you:

  • Safe to exclude: software you downloaded from the official developer's website, game mods from trusted community sources, development tools and compilers that generate false positives, virtual machine files that trigger heuristic detections, large folders that slow down when Defender scans them (like game directories or database folders)
  • Not safe to exclude: files you downloaded from untrusted sources, email attachments from unknown senders, cracked or pirated software, files that multiple antivirus engines flag (check virustotal.com if unsure)
  • When in doubt, upload the file to virustotal.com before excluding it. This site scans the file with 70+ antivirus engines. If only Defender flags it and all others say it is clean, it is likely a false positive and safe to exclude

Add a file exclusion

To exclude a specific file from Defender scanning:

  1. Open Windows Security (search for it in Start, or click the shield icon in the system tray)
  2. Click Virus and threat protection
  3. Scroll down to Virus and threat protection settings and click Manage settings
  4. Scroll down to Exclusions and click Add or remove exclusions
  5. Click Add an exclusion → select File
  6. Browse to the file you want to exclude and select it. The file path now appears in the exclusions list
  7. Defender immediately stops scanning this file. If the file was quarantined, you may need to restore it first (see the restore section below) and then add the exclusion

Add a folder exclusion

Excluding an entire folder is useful when a program generates many files that trigger false positives, or when Defender scanning slows down a program that reads and writes many files:

  1. Follow the same steps as above: Windows Security → Virus and threat protection → Manage settings → Exclusions → Add or remove exclusions
  2. Click Add an exclusion → select Folder
  3. Browse to the folder and select it. All files inside this folder and its subfolders are excluded from scanning
  4. Common folders to exclude for performance: game installation directories (like Steam or Epic Games libraries), software development project folders, virtual machine disk folders, database data directories, video editing project folders with large media files
  5. Keep folder exclusions as narrow as possible. Excluding your entire C: drive or user profile folder defeats the purpose of having antivirus protection

Add a process exclusion

Process exclusions tell Defender to ignore all file activity from a specific program. This is the best option for development tools, compilers, and programs that create many temporary files:

  1. In the Exclusions settings, click Add an exclusion → select Process
  2. Type the process name (like devenv.exe for Visual Studio, or java.exe for Java applications). You can enter just the name or the full path
  3. When a process exclusion is active, Defender does not scan any files that the excluded process opens, creates, or modifies. The process itself is still scanned when it launches
  4. Process exclusions are more targeted than folder exclusions because they only apply to file activity from that specific program, not to all files in a location

Add a file type exclusion

You can exclude all files with a specific extension from scanning:

  1. In the Exclusions settings, click Add an exclusion → select File type
  2. Type the extension without the dot (for example, type iso for .iso files, or vhd for virtual hard disk files)
  3. All files with this extension anywhere on the computer are excluded from scanning
  4. Use file type exclusions sparingly — excluding common types like .exe or .dll would be dangerous. This is best for specialized file types like virtual machine disks (.vhd, .vhdx, .vmdk), database files (.mdf, .ldf), or disc images (.iso) that are large and safe

Restore a quarantined file

If Defender already quarantined the file before you could add an exclusion, you need to restore it first:

  1. Open Windows Security → Virus and threat protection → Protection history
  2. Find the quarantined file in the list. Click on it to expand the details
  3. Click Actions → Restore. The file is restored to its original location
  4. Immediately add an exclusion for the restored file (using the steps above) to prevent Defender from quarantining it again on the next scan
  5. If you do not see a Restore option, click Allow on device instead. This tells Defender the file is safe and restores it

Add exclusions through PowerShell

For administrators or advanced users who need to add multiple exclusions quickly, PowerShell is faster than the GUI:

  1. Open PowerShell as administrator
  2. Add a folder exclusion: Add-MpPreference -ExclusionPath "C:\path\to\folder"
  3. Add a file exclusion: Add-MpPreference -ExclusionPath "C:\path\to\file.exe"
  4. Add a process exclusion: Add-MpPreference -ExclusionProcess "processname.exe"
  5. Add a file type exclusion: Add-MpPreference -ExclusionExtension "iso"
  6. View all current exclusions: Get-MpPreference | Select-Object -ExpandProperty ExclusionPath
  7. Remove an exclusion: Remove-MpPreference -ExclusionPath "C:\path\to\folder"

Add exclusions through Group Policy

In business environments, exclusions can be deployed to multiple computers through Group Policy:

  1. Press Win+R → type gpedit.msc → press Enter (Pro and Enterprise only)
  2. Navigate to Computer Configuration → Administrative Templates → Windows Components → Microsoft Defender Antivirus → Exclusions
  3. There are separate policies for Path Exclusions, Extension Exclusions, and Process Exclusions
  4. Double-click the exclusion type → Enabled → click Show → add the paths, extensions, or process names
  5. Group Policy exclusions cannot be removed by standard users through the Windows Security interface, which is useful for managed environments

Exclusion best practices

Keep your exclusions effective and secure:

  • Review exclusions periodically. Open the exclusions list every few months and remove any that are no longer needed — old exclusions for uninstalled programs create unnecessary security gaps
  • Be specific. Exclude the narrowest path possible. Exclude the specific game folder, not your entire Program Files directory. Exclude the specific process, not all .exe files
  • Document why. If you manage multiple computers, keep a note of why each exclusion was added. Months later you may not remember if an exclusion is still needed
  • Test after excluding. After adding an exclusion, verify the program works correctly. Sometimes the problem was not Defender but something else, and the exclusion was unnecessary
  • Never exclude system folders. Do not exclude C:\Windows, C:\Windows\System32, or your entire user profile. These are where real malware hides

Remote Defender configuration help

If you need help configuring Windows Defender exclusions or resolving false positives, Marion Remote Fix can assist remotely — setting up exclusions, restoring quarantined files, and verifying that your security configuration is correct through a secure remote session.

← Back to Blog