Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've messed up my file permissions on my home directory. Here's a small sampling of the output from AccessEnum

enter image description here

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.

share|improve this question

3 Answers 3

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.

share|improve this answer
    
This helped, but isn't ideal as it sets explicit permissions on each object. –  Scott Weinstein Nov 19 '11 at 19:47
    
You could use icacls.exe instead. That is, remove the /t switches from the cacls commands above, so they don't process child items. Then do something like: for /f %a in ('dir C:\Users\Scott /a-l /b') do @icacls "C:\Users\Scott\%a" /reset /t /l /c –  Patrick S. Nov 19 '11 at 23:13

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
share|improve this answer

Do a repair install (inplace upgrade) of Windows. Make sure you back up first. Also, you will need to reinstall all updates and maybe some programs.

share|improve this answer
    
Doesn't this have a lot of side effects? –  Tom Wijsman Nov 19 '11 at 19:18
    
Please specify what you mean by side effects. –  kinokijuf Nov 19 '11 at 19:35
    
A side effect is an effect that is secondary to the one intended. –  Tom Wijsman Nov 19 '11 at 19:38
    
You will need to reinstall all updates and maybe some programs. Also, you’d better back up. –  kinokijuf Nov 19 '11 at 19:55
    
I'm looking for something way simpler and more targeted. –  Scott Weinstein Nov 20 '11 at 1:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.