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.

link|improve this question

67% accept rate
feedback

2 Answers

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.

link|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
feedback

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.

link|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
show 1 more comment
feedback

Your Answer

 
or
required, but never shown

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