Introduction
Windows Defender (the built-in antivirus in Windows 10 and 11) actively protects your system, but it can sometimes misidentify legitimate programs as threats. This can lead to blocking necessary software, such as specialized development tools, game launchers, or older versions of programs.
Adding an exclusion (whitelist) allows you to instruct Defender to skip specific files, folders, or file types during scans. This is safe if you trust the source and helps avoid false positives without completely disabling protection.
After completing this guide, you will be able to flexibly configure exclusions through the graphical interface, the registry, or PowerShell.
Requirements
Before you begin, ensure that:
- You have administrator privileges (to add exclusions that apply to all users).
- You are running Windows 10 (version 1903 or later) or Windows 11.
- You know the exact path to the file or folder you need to exclude, or the process name.
- The program or file you are adding is not malicious (only exclude files from verified sources).
Step-by-Step Instructions
Method 1: Through the Windows Security Graphical Interface (Recommended)
This method is suitable for most users and does not require deep system knowledge.
- Open the "Windows Security" app.
- Press Win + S, type
Windows Security, and select the app from the results. - Or click the shield icon in the notification area (system tray) and select "Open".
- Press Win + S, type
- Navigate to the exclusions settings.
- In the left pane, select "Virus & threat protection".
- In the "Exclusions" section, click the "Manage settings" button.
- Next to "Exclusions," click "Add or remove exclusions".
- Add a new exclusion.
- Click the "Add an exclusion" button.
- Select the type of exclusion:
- File — excludes one specific file (e.g.,
C:\Program Files\MyApp\app.exe). - Folder — excludes all files within the specified folder and its subfolders (e.g.,
C:\MyTools\). - File type — excludes all files with a specific extension (e.g.,
.test). - Process — excludes a running process by name (e.g.,
myapp.exe).
- File — excludes one specific file (e.g.,
- Specify the path or select the file/folder via the dialog window.
- Click "OK" to confirm.
- Review the list.
- After adding, the exclusion will appear in the table. Ensure the path is correct.
Method 2: Through the Registry Editor (For Advanced Users)
If you need to add exclusions in bulk or automate the process, you can edit the registry.
- Press Win + R, type
regedit, and press Enter. - Navigate to the following path:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Defender\Exclusions\Paths - In the right pane, right-click → New → String Value.
- Name the value according to the path (e.g.,
C:\MyFolder). - Double-click the newly created value and enter the same path in the "Value data" field.
- Close the Registry Editor. Changes take effect immediately.
⚠️ Important: Incorrect registry editing can disrupt system functionality. Create a restore point before making changes.
Method 3: Through PowerShell (Administrator)
PowerShell allows adding exclusions via the command line, which is convenient for scripts.
- Open PowerShell as Administrator (Win + X → Windows PowerShell (Admin)).
- Use the
Add-MpPreferencecmdlet. Examples:- Exclude a folder:
Add-MpPreference -ExclusionPath "C:\MyFolder" - Exclude a file:
Add-MpPreference -ExclusionPath "C:\Program Files\MyApp\app.exe" - Exclude an extension
.log:Add-MpPreference -ExclusionExtension ".log"
- Exclude a folder:
- To view the list of exclusions, run:
Get-MpPreference | Select-Object -ExpandProperty ExclusionPath
Verifying the Result
After adding an exclusion, ensure Defender no longer blocks the object:
- Try to run the program or access the folder that was previously blocked.
- Check the protection history: In "Windows Security" → "Virus & threat protection" → "Protection history". Events related to the excluded object should not appear.
- If necessary, temporarily disable real-time protection (via the same settings) and check if the issue persists. Do not leave protection disabled.
Potential Issues
| Problem | Solution |
|---|---|
| No administrator rights | Run the security settings or PowerShell as administrator. |
| Exclusion not working | Ensure the path is absolute (e.g., C:\Folder\, not \Folder\). For processes, specify only the filename (e.g., app.exe). |
| Defender still blocks | Check other protection components: "Malware protection" and "Windows Defender Firewall". You may need to add the exclusion there as well. |
| Error when adding via registry | Ensure you are editing the Paths key for paths, not Extensions for file extensions. |
| Exclusion only applies to current user | Add the exclusion as an administrator to apply it to all users. |
Conclusion
Adding exclusions to Windows Defender is a simple and effective way to eliminate false positives. Use the graphical interface for one-time tasks, and the registry or PowerShell for automation. Remember that exclusions reduce your security posture, so only add them for absolutely trusted files and regularly review your exclusion list.