A Folder in Windows has lost all permissions, how can I fix or delete it?
I would first suggest running chkdsk /f
on the disk, which will make sure the security information isn't corrupted. It should restore the directory to some 'standard' permissions.
If you're an administrator, you should be always able to take ownership using takeown
, and then write new ACL using e.g. icacls … /reset
.
Restart your computer. This may be a folder that has failed to delete, it should disapear on a restart and can be re-created safely
On the parent folder, right click, choose properties, security.
From there go to Advanced
If you are using a standard user, press the button Change permissions and supply administrative credentials.
You should now see a checkmark at the bottom stating:
[ ]
Replace all child object permission entries with inheritable permission entries from this object.
Check this checkbox and press Apply.
Every subfolder will now get their permissions reset, including the one you lost access to.
If you can't afford any other folder to be affected, you can try to move the folder in question to a new folder and try it as such, or move all other folders away.
I just had a similar issue where ICACLS and the TAKEOWN commands were not getting it done. I was using ICACLS and after finding this post I also tried TAKEOWN:
icacls N:\* /grant UserName:(oi)(ci)f
takeown /F N:\*
What finally corrected the issue was explicitly setting the INHERITANCE switch in ICACLS:
icacls N:\* /grant UserName:(oi)(ci)f /inheritance:e