Fix "You Need Permission to Perform This Action"
The Problem
Windows checks two things before it lets you touch a file: who owns it, and what the access control list says your account may do. Both are stored with the file, not with the PC — so files copied from an old machine, restored from a backup, or left behind by a deleted user account carry permissions that refer to an account that no longer exists.
The result is being locked out of your own documents on your own PC, even from an administrator account. Fixing it means taking ownership and then granting your account access.
Error says the file is in use rather than denied? Different cause — see fix "file is open in another program". Whole user profile misbehaving? Test a new account as described in Step 8.
Symptoms
- "You'll need to provide administrator permission to delete this folder."
- "You don't currently have permission to access this folder."
- "Access is denied" when opening, renaming, or saving a file.
- Folders from an old PC or an external drive show a padlock overlay.
- An Unknown Account with a long
S-1-5-21-…identifier appears in the Security tab.
Step 1: Confirm You Are an Administrator
- Open Settings → Accounts → Your info.
- Under your name it should say Administrator. If it says Standard user, you cannot change permissions.
- To change it, sign in with an administrator account and use Settings → Accounts → Other users → select the account → Change account type.
- On a work or school PC, permissions are set by policy — contact IT rather than overriding them.
Step 2: Take Ownership Through the Properties Dialog
This is the safe, reversible route for a specific folder.
- Right-click the folder → Properties → Security tab → Advanced.
- At the top, next to Owner, click Change.
- Type your Windows account name (or Administrators) into the box, click Check Names, then OK.
- Tick Replace owner on subcontainers and objects.
- Click Apply. Accept any warnings and let it work through the folder tree — this can take several minutes on a large folder.
- Do not close the dialog yet; continue to Step 3.
Step 3: Grant Your Account Full Control
Ownership alone does not grant access. This step does.
- Still in Advanced Security Settings, click Add → Select a principal.
- Type your account name → Check Names → OK.
- Set Type to Allow and tick Full control.
- Click OK.
- Back on the main list, tick Replace all child object permission entries with inheritable permission entries from this object.
- Click Apply → OK, and confirm the warning.
- Close and reopen the folder.
Step 4: Do It from Terminal for Large or Stubborn Trees
Faster than the dialog, and it does not stall on a deep folder tree.
- Right-click Start → Terminal (Admin).
- Take ownership recursively:
takeown /f "D:\Path\To\Folder" /r /d y - Grant your account full control:
icacls "D:\Path\To\Folder" /grant "%USERNAME%":F /t /c /twalks subfolders;/ccontinues past individual errors.- Get the exact path by right-clicking the folder → Copy as path.
- Expect some Access is denied lines on system-protected items — those are normal and safe to ignore.
Step 5: Remove Stale Accounts from the Permission List
An Unknown Account entry is a leftover from a machine or user that no longer exists.
- Right-click the folder → Properties → Security → Advanced.
- Select each Unknown Account (S-1-5-21-…) entry and click Remove.
- Confirm your own account and Administrators are still listed with Full control before you close the dialog.
- Click Apply → OK.
- Removing every entry, including SYSTEM, leaves the folder inaccessible to Windows itself — always leave SYSTEM and Administrators in place.
Step 6: Reset Permissions on a Whole Drive Cleanly
Use this when an entire external or secondary drive is inaccessible.
- In Terminal (Admin), reset inheritance across the drive:
icacls "D:\" /reset /t /c - Then re-grant access:
icacls "D:\" /grant "%USERNAME%":F /t /c - Replace
D:with the correct letter — check in Windows + R →diskmgmt.mscfirst. - Never run this against
C:\. Resetting permissions on the Windows drive breaks the installation, and repairing it means a reinstall. - Related: partition and format a hard drive.
Step 7: Check for Encryption Rather Than Permissions
An encrypted file looks like a permissions problem but is not one.
- Right-click the file → Properties → Advanced. If Encrypt contents to secure data is ticked, it uses EFS and only the original account with its certificate can read it.
- Green file names in Explorer indicate EFS encryption; blue indicates compression.
- Without the original account or its exported certificate, the data is not recoverable — that is the point of encryption.
- For whole-drive encryption, you need the recovery key: enable BitLocker drive encryption.
Step 8: Test with a New User Account
This separates a damaged profile from damaged file permissions.
- Settings → Accounts → Other users → Add account → I don't have this person's sign-in information → Add a user without a Microsoft account.
- Make it an administrator, sign in, and try to open the folder.
- If it works there, your original profile is damaged — move your data to the new account.
- If it fails there too, the file permissions are the problem; repeat Steps 2-4.
Step 9: Repair Windows and Rule Out Ransomware
- In Terminal (Admin):
sfc /scannowDISM /Online /Cleanup-Image /RestoreHealth - Reboot and re-run
sfc /scannow: how to run SFC and DISM. - If files across many folders became inaccessible at once, and file names or extensions have changed, stop and treat it as ransomware — do not pay, and do not reformat before reading what to do if hit by ransomware.
- Also check Windows Security → Virus & threat protection → Ransomware protection → Controlled folder access. If it is on, it blocks apps you have not allowed from writing to Documents and Pictures — add the app under Allow an app through Controlled folder access.
What Not to Do
- Don't run
icacls C:\ /reset /t. It destroys the permission model Windows depends on and the PC will need reinstalling. - Don't disable UAC to work around prompts. It removes a real security boundary and does not fix ownership.
- Don't grant Full control to "Everyone" on folders holding personal data — especially on a shared or network drive.
- Don't take ownership of
C:\WindowsorProgram Files. Windows Update and system repair both depend on TrustedInstaller owning those.
Still Not Working?
If ownership and permissions are correct and access is still denied, check whether the file sits on a drive from another PC where BitLocker or EFS was used, and whether a security suite is enforcing its own protection layer. Pause the suite and retest.
For a drive whose data you need but cannot unlock, connect it to the original PC and copy the files from there — that is far more reliable than fighting the ACLs: transfer files from an old PC to a new PC.
Related: how to recover deleted files and organise and back up important documents.
Related guides
Fix "File Is Open in Another Program" in Windows 11
Windows 11 refusing to delete a file because it is in use? Find the process holding it, close the handle safely, and delete stubborn files and folders for good.
How to Fix Drag and Drop Not Working in Windows 11
Cannot drag files in File Explorer or drop them onto the taskbar in Windows 11? Clear the stuck drag state, fix Explorer, and rule out the shell extensions behind it.
How to Spot and Remove a Fake Antivirus or Scareware
Browser locked by a virus warning? Remove fake antivirus pop-ups and tech-support scareware on Windows 11 without calling the number on screen.
How to Fix Windows Defender Not Working or Turned Off
Windows Security shows threats need attention but Defender won't turn on—fix group policy blocks, stale services, and malware that disables antivirus.
How to Remove a Virus or Malware from Windows 11
Pop-ups, unknown toolbars, or a PC that slowed overnight—run Windows Defender offline, cut startup malware, and clean browsers without sketchy 'cleaner' apps.