"You have been denied permission to access this folder"
Windows blocks you from opening a folder you own. The ownership got mangled — usually because the folder came from another machine, another user, or a backup drive. Here is how to fix it properly, including the subfolder trap that the standard guide misses.
Before you start — do not do this on system folders
If the folder you cannot access is somewhere inside C:\Windows, C:\Program Files, or C:\ProgramData: stop. Taking ownership of those folders breaks Windows updates and several built-in features. There is almost always a different fix for those — usually you do not actually need access, and the application that uses the folder reads it correctly via SYSTEM permissions you cannot see.
The instructions below are for your own data folders: documents, photos, projects, copies from old hard drives, anything in C:\Users\YourName or on a secondary drive.
The proper fix (propagates to all subfolders)
Step 1 — open the folder Properties
Right-click the locked folder → Properties → Security tab.
You will likely see a message at the bottom: "You must have read permissions to view the properties of this object". That is fine — click Advanced at the bottom anyway.
Step 2 — change the owner
In the Advanced Security Settings window, the Owner line at the top probably says something like "Unable to display current owner" or shows an unknown account.
- Click Change next to the owner.
- In the new window, type your Windows username (or click "Advanced" then "Find Now" and pick yours from the list).
- Click OK.
- You return to the Advanced window. Tick the box Replace owner on subcontainers and objects. This is the key — without it, only the top folder gets the new owner.
- Click Apply. Wait — depending on folder size this can take from seconds to many minutes.
Step 3 — grant yourself permissions
Owner ≠ permissions. After taking ownership, you still need to add an ACL entry for your account.
- Still in Advanced Security Settings, click Add.
- Click Select a principal. Type your username, click OK.
- Under "Basic permissions", tick Full control.
- At the bottom, tick Replace all child object permission entries with inheritable permission entries from this object.
- Click OK on each window. Confirm any "are you sure" dialogs.
- Wait for the apply step to finish — large folders can take several minutes.
Try opening the folder. Should work now.
Faster alternative — Command Prompt (admin)
If you have many folders to fix, the GUI gets tedious. From an admin Command Prompt:
takeown /F "C:\Path\To\Folder" /R /D Y icacls "C:\Path\To\Folder" /grant:r "%USERNAME%":(OI)(CI)F /T
Line 1 takes ownership recursively. Line 2 grants Full control to your current user, recursively, with inheritance. Replace the path with your actual folder.
If "Access denied" still appears after the fix
- The folder is encrypted with EFS. The little gold padlock or green text in Explorer is the giveaway. EFS files can only be opened by the user who originally encrypted them. If you no longer have that account, the data is unrecoverable without the recovery certificate.
- The folder is on a BitLocker drive that is not unlocked. Check Disk Management — the drive will show as "BitLocker locked".
- The folder is in OneDrive or another cloud-sync location. Sometimes the cloud client holds an exclusive lock. Pause sync, try again, resume sync.
- Anti-ransomware "Controlled folder access". Settings → Privacy & Security → Windows Security → Virus & Threat Protection → Manage ransomware protection. Check whether the folder is protected and the application you are using is not on the allow list.