You are currently viewing Use PowerShell to add exclusion folder or file Extension on the Windows Defender

Use PowerShell to add exclusion folder or file Extension on the Windows Defender

Sometimes, you need to exclude the folder or specific file extension from being scanned by Windows Defender.
Below is the PowerShell command that you can use to do that :

  1. Open Windows PowerShell with elevated permissions.
  2. To exclude the specific folder (e.g C:\Folder1). Run the following command Add-MpPreference -ExclusionPath “C:\Folder1”
  3. Another case, if you want to exclude the .txt file type/extension. Run the following command Add-MpPreference -ExclusionExtension “txt”

For more detail about this command, you can check here.

This Post Has One Comment

  1. Hasan

    How can I do this command with CMD.
    Thank you for your answer.

Leave a Reply