How to enable ransomware protection on Windows 11

To enable ransomware protection on Windows 11, open Windows Security, go to Virus & threat protection > Manage ransomware protection, and switch Controlled folder access to On.

This guide covers the Windows Security toggle, protected folders, allowed apps, the PowerShell and Group Policy routes, OneDrive file recovery and how to turn the feature off again. The same steps work on Windows 10.

How to enable ransomware protection on Windows 11
The Ransomware protection section sits at the bottom of Virus & threat protection; select Manage ransomware protection to reach the Controlled folder access toggle. (Image: Microsoft)

Enable ransomware protection on Windows 11

Ransomware protection in Windows 11 is the Controlled folder access feature of Microsoft Defender Antivirus, one of the built-in Windows Security protections. It is off by default on every edition, including Windows 11 Home.

  1. Open Start, type Windows Security and open the app.
  2. Select Virus & threat protection.
  3. Under Ransomware protection, select Manage ransomware protection.
  4. Under Controlled folder access, switch the toggle to On.
  5. Select Yes in the User Account Control prompt.
  6. If you used the feature before, choose whether to keep the protected folders and allowed apps you set up last time.

Once it is on, two more links appear in the same section: Protected folders and Allow an app through Controlled folder access. Untrusted apps can no longer change or delete files in protected folders, and Windows shows a notification each time it blocks one.

What is controlled folder access in Windows 11?

Controlled folder access counters ransomware by letting only trusted apps change files in protected folders. Microsoft Defender Antivirus trusts most well-known apps automatically, based on how widely they are used and their reputation.

Part What it does
Protected folders Untrusted apps cannot modify or delete files in these folders. A fixed default set is protected, and you can add more.
Trusted apps Apps allowed to change files in protected folders. Defender checks every executable type, including .exe, .scr and .dll files.
Disk sectors Untrusted apps cannot write directly to the boot record, which blocks bootkits and disk-wiper malware.
Notifications A pop-up appears when an app is blocked, and the block is logged in Protection history.
Requirement Microsoft Defender Antivirus must be the active antivirus with Real-time protection on. The feature does not work when Defender is in passive mode or off.

Controlled folder access sits alongside the other Defender hardening options, such as Exploit Protection in Windows 11, which guards running processes rather than files.

Controlled folder access default protected folders

The default list cannot be edited or shortened. It covers these locations for every user account and for system accounts such as LocalService and NetworkService.

Location Default path
Boot sectors Hard drive boot sectors
Documents C:\Users\<username>\Documents and C:\Users\Public\Documents
Pictures C:\Users\<username>\Pictures and C:\Users\Public\Pictures
Music C:\Users\<username>\Music and C:\Users\Public\Music
Videos C:\Users\<username>\Videos and C:\Users\Public\Videos
Favorites C:\Users\<username>\Favorites

If a folder is redirected, the protection follows it. When OneDrive backs up your Documents or Pictures folder, Windows protects the copy inside the OneDrive folder. With the feature on, the default folders appear at the bottom of the Protected folders list.

Allow apps ransomware protection on Windows 11

Add an app only when Windows blocks it and you know it is safe, such as a photo editor or backup tool that saves into Documents. Most popular apps are trusted automatically and never need adding.

  1. Open Windows Security > Virus & threat protection > Manage ransomware protection.
  2. Select Allow an app through Controlled folder access.
  3. Select Yes in the User Account Control prompt.
  4. Select + Add an allowed app.
  5. Choose Recently blocked apps to pick an app Windows has just stopped, or Browse all apps to find its .exe or .com file.
  6. Close and reopen the app so the new permission takes effect.

The permission is tied to that exact file location. A copy of the same program in a different folder is not trusted and may still be blocked.

Protect other folders against ransomware on Windows 11

Add a folder when you keep important files outside the default locations, for example a work folder on a second drive. Subfolders of an added folder are protected too.

  1. Open Windows Security > Virus & threat protection > Manage ransomware protection.
  2. Select Protected folders.
  3. Select Yes in the User Account Control prompt.
  4. Select + Add a protected folder.
  5. Browse to the folder and select it.
  6. Repeat for each extra folder you want guarded.

Network shares and mapped drives can be added. For a folder you share from this PC, add its local path such as C:\demo, not the \\mycomputer\demo share path.

Turn on controlled folder access with PowerShell

PowerShell sets the same feature and also unlocks Audit Mode, which logs what would be blocked without stopping anything. Open PowerShell with Run as administrator first.

Set-MpPreference -EnableControlledFolderAccess Enabled

Valid values are Disabled (0), Enabled (1), AuditMode (2), BlockDiskModificationOnly (3) and AuditDiskModificationOnly (4). To add a folder without replacing the existing list, run Add-MpPreference -ControlledFolderAccessProtectedFolders "D:\Work". To allow an app, run Add-MpPreference -ControlledFolderAccessAllowedApplications "C:\Apps\app1.exe".

You should see: No output on success. The toggle in Windows Security now shows On.

Use Add-MpPreference rather than Set-MpPreference for folders and apps. Set-MpPreference overwrites the whole list with the values you give it.

Enable controlled folder access with Group Policy

Windows 11 Pro, Enterprise and Education include the Local Group Policy Editor. A policy set here overrides the toggle in Windows Security.

  1. Press Win + R, type gpedit.msc and press Enter.
  2. Go to Computer Configuration > Administrative Templates > Windows Components > Microsoft Defender Antivirus > Microsoft Defender Exploit Guard > Controlled Folder Access.
  3. Double-click Configure controlled folder access.
  4. Select Enabled.
  5. Under Configure the guard my folders feature, choose Block.
  6. Select OK.

To add folders or apps through policy, open Configure protected folders or Configure allowed applications, select Enabled, select Show…, and enter each path as the value name with 0 as the value.

Enable controlled folder access with Group Policy: Configure Controlled folder access set to Enabled
Select Enabled, then pick Block or Audit Mode under Configure the guard my folders feature before you click OK. (Image: Microsoft)

How to tell if controlled folder access is on

Get-MpPreference | Format-Table EnableControlledFolderAccess

Run it in an elevated PowerShell window. To list the default protected folders, run (Get-MpPreference).ControlledFolderAccessDefaultProtectedFolders, which returns results only while the feature is on.

You should see: 1 means on (block), 2 means Audit Mode and 0 means off.

Without PowerShell, open Manage ransomware protection and check that the Controlled folder access toggle reads On and the Protected folders link is visible.

Controlled folder access event IDs in Event Viewer

Every block and audit is written to the Defender log. Open Event Viewer and expand Applications and Services Logs > Microsoft > Windows > Windows Defender > Operational, then filter by these IDs.

Event ID Meaning
1123 An app was blocked from changing a protected folder
1124 An app would have been blocked (Audit Mode)
1127 A write to the disk boot sectors was blocked
1128 A write to the disk boot sectors was audited
5007 Defender settings were changed

Blocked apps also appear in Windows Security > Protection history as Protected memory access blocked entries.

Set up ransomware data recovery with OneDrive

The Ransomware data recovery section of the same page links Windows Security to OneDrive. Files stored in OneDrive keep version history, and Microsoft 365 subscribers can roll the whole OneDrive back to any point in the last 30 days.

  1. Under Ransomware data recovery on the Ransomware protection page, sign in to OneDrive if prompted.
  2. Move or back up your important folders to OneDrive.
  3. After an attack, scan and clean every device that syncs with OneDrive first.
  4. Go to onedrive.com and sign in.
  5. Select Settings > Options > Restore your OneDrive (work or school accounts: Settings > Restore OneDrive).
  6. Choose a date such as Yesterday, or select Custom date and time.
  7. Review the Activity chart and Activity feed, then select Restore.

Without a Microsoft 365 subscription you can still restore individual files from version history, but not the entire OneDrive. Microsoft advises against paying a ransom, because payment does not guarantee you get your files back.

Ransomware data recovery with OneDrive: Restore your OneDrive date picker and activity feed
Pick a date such as Yesterday, check the activity chart and feed for the changes to undo, then select Restore. (Image: Microsoft)

Disable ransomware protection on Windows 11

Turning the feature off lets every app change files in your folders again. Your list of protected folders and allowed apps is kept, and Windows offers to reuse it when you switch back on.

  1. Open Windows Security > Virus & threat protection.
  2. Select Manage ransomware protection.
  3. Switch Controlled folder access to Off.
  4. Select Yes in the User Account Control prompt.

In PowerShell, the equivalent is Set-MpPreference -EnableControlledFolderAccess Disabled. If a single app is the problem, allowing that app is safer than switching the whole feature off.

Disable ransomware protection on Windows 11 from the Windows Security home page
Select the Virus & threat protection tile, then Manage ransomware protection, and switch Controlled folder access to Off. (Image: Microsoft)

Controlled folder access blocking apps on Windows 11

"App is blocked" notification from Windows Security

An app without enough reputation tried to save into a protected folder.

  1. Select the notification, or open Windows Security > Protection history, and note the app's path.
  2. Confirm the app is one you installed and trust.
  3. Open Manage ransomware protection > Allow an app through Controlled folder access.
  4. Select + Add an allowed app > Recently blocked apps and pick the app.
  5. Restart the app and save the file again.

An allowed app is still blocked

Permissions apply only when an app starts, and only to the exact path you added.

  1. Close the app completely, including any tray icon or background service, then reopen it.
  2. Check Protection history for the path Windows blocked.
  3. If that path differs from the one you allowed, add the blocked path as well.

Controlled folder access missing or cannot be turned on

The feature needs Microsoft Defender Antivirus active with Real-time protection on. Defender switches itself off when another antivirus is installed.

  1. Open Windows Security > Virus & threat protection and check which antivirus is listed as active.
  2. If another antivirus is active, use its own ransomware or folder protection instead.
  3. If Defender is active, select Manage settings under Virus & threat protection settings and make sure Real-time protection is On.
  4. On a work PC, ask your IT administrator, because a Group Policy or Intune setting overrides the toggle.

Windows 11 ransomware protection FAQ

Does Windows 11 have built-in ransomware protection?

Yes. Windows 11 includes Controlled folder access in Windows Security, which blocks untrusted apps from changing files in protected folders. It is off by default, so you turn it on under Virus & threat protection > Manage ransomware protection.

Is ransomware protection available on Windows 11 Home?

Yes. Controlled folder access is part of Microsoft Defender Antivirus, which ships with every Windows 11 edition, including Home. Only the Group Policy route needs Pro, Enterprise or Education; the Windows Security toggle and PowerShell work on Home.

Should I turn on controlled folder access?

Turn it on if you rely on Microsoft Defender and keep important files in Documents, Pictures or other local folders. Expect an occasional block on a lesser-known app that saves into those folders, which you fix by allowing that one app.

Why is ransomware protection off by default?

Controlled folder access can block legitimate apps that are not yet trusted, such as older or niche tools that write into protected folders. Microsoft ships it disabled and recommends testing with Audit Mode first so these apps can be allowed before blocking starts.

Does controlled folder access work with a third-party antivirus?

No. Controlled folder access needs Microsoft Defender Antivirus in active mode with Real-time protection on. When another antivirus is installed, Defender turns itself off and the feature stops working, so use that product's own ransomware protection instead.

Can I add a USB or network drive to protected folders?

Network shares and mapped drives are supported as protected folders, and environment variables work in paths. Wildcards are not supported for protected folders. For a folder shared from the same PC, add its local path rather than the share path.

Does ransomware protection back up my files?

No. Controlled folder access only blocks changes. Backup comes from the Ransomware data recovery section, which uses OneDrive version history. Microsoft 365 subscribers can also restore their whole OneDrive to a point within the last 30 days.

Philip Celasco

Philip is a Texas-based technology writer and IT administrator at Techdows.com with more than 10 years of experience creating practical content for everyday users and professionals. He specializes in web browsers, particularly Chromium-based platforms such as Google Chrome, Microsoft Edge, Brave, and Opera. Through his work as an IT administrator, Philip has hands-on experience managing devices, configuring browser policies, troubleshooting software and network issues, and helping people resolve problems that affect productivity and security. His articles are based on practical testing and real-world technical experience. He covers browser settings, extensions, performance problems, privacy controls, security features, and Windows troubleshooting. Outside work, Philip enjoys the quieter side of life in Texas and stepping away from the screen when he can. He has two kids, two cats and loves to play golf with his mother during the weekends.

Leave a Reply

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