"Access Denied" When Opening a Folder? How to Take Ownership and Get Your Permissions Back (Windows 10/11)

After connecting an old hard drive to a new PC or reinstalling Windows, opening an old folder sometimes shows "You don't currently have permission to access this folder" or "Access is denied". This happens because the folder's owner is still the account from the old PC. Changing the owner to your current account and granting permissions usually fixes it.
Before you start
- Only do this for folders with your own data (for example, photo or recording folders on drive D). Never change the owner of C:\Windows, C:\Program Files or the whole C drive. It can break Windows.
- You must be signed in with an administrator account.
1. With the mouse (Security tab)
- Right-click the folder that will not open and open Properties → Security → Advanced.
- Click Change next to Owner at the top, type your account name (or Microsoft account email), then click Check Names → OK.
- Tick Replace owner on subcontainers and objects and click Apply. It can take a while if there are many files.
- Close the window, go back to Properties → Security → Edit, select your account (click Add if it is missing), tick Full control and click OK.
2. All at once with commands
Right-click Command Prompt in the Start menu, choose Run as administrator, and enter the following, replacing the path in quotes with your folder.
- Take ownership:
takeown /f "D:\Old data" /r /d y - Give your account full control:
icacls "D:\Old data" /grant %username%:F /t
If it still will not open
- If the file names appear in green, they were encrypted with EFS on the old PC. Changing the owner does not help without that PC's certificate.
- If the whole drive is locked with BitLocker, unlock it with the recovery key first.
- If the disk itself has errors, it will not open regardless of permissions, so run a chkdsk scan as well.
Sources: Microsoft Learn – takeown, Microsoft Learn – icacls
Blog
- How to Block or Allow Internet Access for One Program: Windows Firewall Allowed Apps and Outbound Rules (Windows 10/11)
- Blank Icons or Missing Video Thumbnails in File Explorer? How to Rebuild the Icon Cache and Thumbnail Cache (Windows 11)
- How to Check That a Downloaded Program Is Genuine: File Hashes (certutil, Get-FileHash) and Digital Signatures (Windows 10/11)
- Does "Shut Down" Not Fully Shut Down? How to Turn Off Fast Startup and Do a Full Shutdown (Shift + Shut Down)
- Protecting Your Laptop When You Step Away, Part 2: How to Turn On a BitLocker Startup PIN (Windows 11 Pro)
- Can't Delete a File Because "It Is Open in Another Program"? Find What Is Locking It With Resource Monitor (Windows 10/11)
- All Your Desktop Files Gone After Signing In? What to Do When Windows Signs You In With a Temporary Profile (Windows 11)
- "The Recycle Bin Is Corrupted" Error? How to Fix It by Resetting $Recycle.Bin (Windows 10/11)