How can I reset my windows 7 file permissions to a rational state?
I've messed up my file permissions on my home directory. Here's a small sampling of the output from AccessEnum
How can I fix this so that there's one set of rational permissions, that is
Read and Write for on c:\users\scott (recursively) for Administrators and my own account?
Command line solutions preferred.
Solution 1:
Give the Administrators group ownership of the directory...
TakeOwn.exe /f "C:\Users\Scott" /a /r /d y
Grant Administrators and Scott full control.
cacls.exe "C:\Users\Scott" /t /c /g Administrators:F
cacls.exe "C:\Users\Scott" /t /c /e /g Scott:F
Note the double quotes aren't necessary in this case. I do it out of habit.
Update: The line to give Administrators full control doesn't seem to be necessary. TakeOwn apparently does that while it's changing the ownership.
Solution 2:
I had a variation on this problem: 3 files in a random directory were suddenly unavailable, couldn't be opened, deleted, or have their permissions changed. Using a variation of Patrick S. response worked for me:
takeown /F "MyLockedFile"
icacls "MyLockedFile" /reset