FIX: Windows Defender can’t remove a folder from Protected folders

Windows Defender…

If you have read my previous post you can see that I ran into this too.

For me the button Remove was grayed out when I wanted to remove a folder from protected folders in Windows Defender.

Fortunately, there are several ways to remove a folder from protected folders. One of them is with PowerShell (as an administrator). In the below tutorial I will lead you through the steps needed.

FIX: Windows Defender can't remove a folder from Protected folders.
FIX: Windows Defender can’t remove a folder from Protected folders.

Let’s remove a folder that’s grayed out with PowerShell.

  • Go to Start
  • Search for PowerShell
  • Open PowerShell as administrator

Now copy the following cmdlet to notepad and configure -ControlledFolderAccessAllowedApplications

Remove-MpPreference -ControlledFolderAccessAllowedApplications ''

This should contain the file path you want to remove from Protected folders.

So for me that would be: “C:\Users\Bas Wijdenes\OneDrive\Documents”

So the cmdlet will be:

Remove-MpPreference -ControlledFolderAccessProtectedFolders "C:\Users\Bas Wijdenes\OneDrive\Documents"

After running the command in PowerShell the protection is removed from my documents folder and I can finally save files again to this folder.


What does Remove-MpPreference do?

The Remove-MpPreference cmdlet removes exclusions for file name extensions, paths, and processes, or default actions for high, moderate, and low threats.

For more about Remove-MpPreference, you can go to the Remove-MpPreference docs.

Unfortunately -ControlledFolderAccessAllowedApplications isn’t in the docs yet, but with the parameter -ControlledFolderAccessAllowedApplications you specify a file path to exclude from Protected folders.


This is from Microsoft Answers.

This post is from answers.microsoft.com.
I have expanded the existing tutorial with screenshots.

If you have questions regarding this topic, feel free to leave a comment.


The post on Microsoft Answers itself.

endofallflesh Created on June 24, 2020

I can’t remove a Protected Folder in Windows Defender

Hello, I made a video to showcase what is happening. I’m trying to remove a Steam game from my protected folders in Windows Defender because my save data got corrupted, and I need to be able to wipe it to start fresh. Every time I try, Defender closes out during and the folder remains protected. I basically am bricked from playing this specific game now.

Published by

Bas Wijdenes

My name is Bas Wijdenes and I work as a Senior Services Engineer @ Wortell. In my spare time I write about the error messages that I encounter during my work. I am currently occupied with Azure infrastructure and automating with PowerShell.

Leave a Reply

Your email address will not be published. Required fields are marked *