Every Folder Said "You Need Permission" After I Reinstalled Windows…
Every Folder Said "You Need Permission" After I Reinstalled Windows 11: Fixing Files Owned by My Old Account
The drive that suddenly didn't trust me
A few weeks ago I reinstalled Windows 11 on my desktop from scratch. Before I wiped the system drive, I did what I always do: I copied my whole user folder onto a second internal drive (D:) so I could sort through it later. The reinstall went smoothly. Then I opened D:\Backup\Users\TJ to grab a few spreadsheets, and Windows refused. Every subfolder I double-clicked gave me the same dialog: "You need permission to perform this action." A few of them said I'd been denied access outright, with a Continue button that went nowhere.
What made it confusing was that I was signed in with an administrator account, on my own PC, looking at files I had made myself. I've since helped two friends with exactly the same situation after a reinstall or a motherboard swap, so I'm writing down what actually caused it and the order in which I'd fix it now.
What was really going on: a stranger owned my files
I right-clicked one of the stuck folders, chose Properties, and opened the Security tab. Under "Group or user names" there was an entry that didn't look like a name at all. It was a long string starting with S-1-5-21, followed by a run of numbers.
That string is a security identifier (SID). Windows doesn't really store "TJ" on a file's permission list. It stores the SID of the account called TJ. When I reinstalled, my new TJ account got a brand-new SID, even though the name, password and Microsoft account were the same. As far as NTFS was concerned, the files on D: belonged to someone who no longer existed, and the new me was just another user with no rights to that folder.
Once I understood that, the fix made sense. I didn't need a registry hack or a third-party "unlocker". I needed to make my current account the owner of that one backup folder and then give it permission to read and write.
Quick checks I do before touching permissions
Not every "you need permission" message is about ownership, so I run through these first. They take about two minutes.
Is a program holding the file open? Sync clients, antivirus scans and a forgotten Excel window can all block a move or delete. I close them and try again.
Is the drive NTFS? On a USB stick formatted as exFAT or FAT32 there is no Security tab at all, so a permission error there usually means the file is in use or the drive is write-protected.
Am I in a system folder? If the path is inside C:\Windows or C:\Program Files, the owner is usually TrustedInstaller on purpose. I leave those alone (more on that below).
Does the Security tab show a bare SID? If yes, it is almost certainly the reinstall problem I had.
In my case the drive was NTFS, nothing was open, it was a personal backup folder, and the Security tab showed an orphaned SID. So ownership was the job.
Taking ownership of just the backup folder
You can do this through the Advanced button on the Security tab. It works, but with tens of thousands of files it is slow and easy to misclick. I prefer two built-in commands. I opened Command Prompt as administrator (Start, type cmd, right-click, Run as administrator) and ran:
takeown /f "D:\Backup\Users\TJ" /r /d y
The /f switch points at the folder, /r goes through every file and subfolder, and /d y answers "yes" automatically when it hits a folder it can't list yet. The takeown command reference on Microsoft Learn explains each switch if you want to double-check before running it. On my folder it scrolled for a minute or so, printing a success line per item.
Ownership alone didn't let me in, though. Being the owner means you are allowed to change permissions. It doesn't give you any yet. So the second command adds my account with Full control:
icacls "D:\Backup\Users\TJ" /grant "%USERNAME%":(OI)(CI)F /t
(OI)(CI) means the permission is inherited by files and subfolders, F means Full control, and /t applies it to everything already inside. If you run this in PowerShell instead of Command Prompt, put the whole grant in quotes, because PowerShell treats the brackets differently.
After that I could open, edit and move every file in the backup.
Cleaning up the leftover SID
The old SID was still sitting on the permission list. It wasn't hurting anything, but I don't like mystery entries, so I removed it. I copied the exact S-1-5-21 string from the Security tab and ran:
icacls "D:\Backup\Users\TJ" /remove *S-1-5-21-xxxxxxxx-xxxxxxxx-xxxxxxxx-1001 /t
The asterisk tells icacls that you're giving it a SID rather than a name. The icacls documentation covers that syntax, plus /save and /restore. Those are worth knowing if you want to back up a folder's permissions before you change anything. I wish I'd done that first.
Where I draw the line: TrustedInstaller folders
When you search this error, you'll find plenty of advice to take ownership of whole drives or system folders to "get rid of TrustedInstaller". I don't do that, and I talk friends out of it. TrustedInstaller owns files in C:\Windows and Program Files so that Windows Update and the servicing stack can replace them safely. If you take ownership of those, updates can fail in strange ways later, and you've also made it easier for malware running as you to modify system files.
If you hit a TrustedInstaller block, ask what you're actually trying to do. Uninstalling an app should go through Settings > Apps. Getting rid of an old Windows.old folder should go through Storage settings or Disk Cleanup. Removing a stubborn driver is a Device Manager job. Ownership changes are for your own data that got stranded, not for the operating system.
If it still says you need permission
A few times the commands worked and one subfolder still refused. These were the causes:
Explicit Deny entries. A Deny rule beats an Allow. In Advanced security settings, look for any entry whose Type is Deny and remove it if it is on your own data.
Encrypted files (EFS). If the old install encrypted files with EFS and you didn't back up the certificate, ownership won't help, because the files can't be decrypted without that key.
Controlled folder access. Windows Security's ransomware protection can block apps from writing to protected folders. It shows its own notification, but it's easy to miss.
For a wider list of fixes, including Safe Mode and the cases where the error isn't about permissions at all, I keep coming back to this walkthrough on the You Need Permission error on Windows 11. It goes through the Security-tab route step by step, which is handy if you'd rather not use the command line.
What I do differently now
The lesson for me was about how I take backups, not just about permissions. Before a reinstall I now copy personal files to an external drive with a plain file copy, or I use File History, instead of dragging the entire C:\Users folder across with all of its old permissions attached. And if I ever do end up with a stranded folder again, I run icacls /save first so I can undo anything. Then I take ownership of that one folder only, grant myself access, and clean out the old SID. It takes five minutes, and nothing outside my own files gets touched.
Comments
Sign in to join the conversation.
No comments yet.