Applies ToMicrosoft Defender Antivirus

Caution: Adding an exclusion to Windows Security means that Microsoft Defender Antivirus will no longer check those types of files for threats, which could leave your device and data vulnerable. Make sure you really want to do this before you proceed.

Add a file type exclusion

  1. Enter the extension for the file type that you want to exclude from scanning. For example: vhd

  2. Select Add

When you enter the extension you can enter it either with, or without, the leading period. "vhd" and ".vhd" both work exactly the same way.

For more information see: Configure and validate exclusions based on file extension and folder location.

Add a process exclusion

Adding an exclusion for a process means that any file opened by that process will be excluded from real-time scanning. These files will still be scanned by any on-demand or scheduled scans, unless a file or folder exclusion has also been created that exempts them.

Tip: It's recommended that you use the full path and file name to exclude a specific process. This makes it less likely that malware could use the same filename as a trusted and excluded process and evade detection.

To exclude a specific process, from a specific folder

Enter the full path and filename to the process. For example:

C:\MyProcess\test.exe 

This will exclude any files opened by the instance of test.exe that is located in the C:\MyProcess folder. If there is an instance of test.exe located in a different folder, any files that instance of test.exe opens will still be scanned.

To exclude a specific process, regardless of what folder it might exist in

Enter just the full name of the process. For example:

test.exe

This will exclude any file opened by the test.exe process, no matter what folder test.exe is located in.

For more information see: Configure exclusions for files opened by processes.

Using wildcards or environment variables

You can use a wildcard ("*") to substitute for any number of characters.

In file type exclusions

If you use an asterisk in the file extension it acts as a wildcard for any number of characters. "*st" will exclude .test, .past, .invest, and any other file types where the extension ends in a st.

In process exclusions

  • C:\MyProcess\* will exclude files opened by all processes, located in C:\MyProcess, or any subfolders of C:\MyProcess.

  • test.* will exclude files opened by all processes named test, regardless of the file extension.

You can use environment variables in your process exclusions as well. For example:

%ALLUSERSPROFILE%\CustomLogFiles\test.exe

This will exclude any files opened by C:\ProgramData\CustomLogFiles\test.exe. For a complete list of Windows environment variables see: Recognized Environment Variables.

See also

Common mistakes to avoid when defining exclusions

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.