Fixing files inaccessible due to broken NTFS-permissions
I have run into this problem a few times. Mostly on USB-drives that I then want to use on another system, or after reinstalling my Windows-machines and thereby changing the user ID's of the users.
Open a command-prompt with escalated ("Administrator") privileges:
- Press the Start-button.
- Type "cmd".
- Right-Click "Command Prompt" that shows up, and click "Run as Administrator" (or just hit CTRL+SHIFT+ENTER).
Now go to the problematic area, and use the following commands:
TAKEOWN /F [dir] /R /D Y
CD [dir]
ICACLS * /T /Q /C /RESET
Where [dir]
is to be replaced with the path to the directory you're trying to fix.
It will, in order of the above commands:
- Forcible make you own all files in that directory, recursively.
- Change in to the directory.
- Reset all Access Control Lists on every object in that directory to the system default.