cannot reset file permissions on two folders

I am working on a clients PC and there are two folders that I cannot delete. I am logged in as the administrator and resetting the permissions still doesn't allow me to delete those two folders.
How do I forcibly take control of them so that I can delete them and all the files underneath those two folders?

What error message do you get when you attempt to delete these folders?

What error message do you get when you attempt to delete these folders?

Can you make yourself the owner of the folders, then change permissions and finally delete?

access denied on lots of the files underneath those two folders.
I've also tried Takeown /R /F C:Temp and that didn't reset them
BTW, the two folders are in C:Temp

OK, here is something to try.
1. Download PsExec.exe from
Boot into Safe Mode to ensure nothing is accessing the files in the folder.
Move PsExec to C:Temp
Open a command prompt with Administrator Privileges and CD into C:temp.
Run: psexec -s -i cmd.exe, this installs a temporary service which will open a command prompt under LOCAL SYSTEM account. The service will be automatically deleted after you exit from the psexec prompt.
Run: ATTRIB -R -S -H
Run: TAKEOWN /F /R /D Y, this will set the Administrators group as owner, it recurses all folders and files in the folder.
To give the Administrators group full control rights, run ICACLS /grant administrators:F /T, the /T indicates that this operation is performed on all matching files and directories below the directories specified.

This process may take a few logoff/logon or reboots to catch every file and folder.

Try this really excellent and free utility to remove the locks on chosen files and folders ...

Share this

Related Posts