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
I have expanded the existing tutorial with screenshots.

If you have questions regarding this topic, please go to the following page:
Why are you using forum posts from Microsoft Community?

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 PowerShell DevOps Engineer. In my spare time I write about interesting stuff that I encounter during my work.

One thought on “FIX: Windows Defender can’t remove a folder from Protected folders”

Leave a Reply

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