Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

There is a big, complex directory structure on a relative big NTFS partition. Somebody managed to put very bad security privileges onto it - there are directories with randomly given/denied permissions, etc. I already run into permission bugs multiple times, and I found insecure permission settings multiple times (for example, write permissions for "Everyone", or false owners).

I don't have time to check everything by hand (it is big).

But luckily, my wishes are very simple. The most common: read/write/execute on anything for me, and maybe read for Everyone.

Is it possible to somehow

  • remove all security data from a directory
  • and giving my (simple) wishes to overwrite everything there?

On Unix, I used a chown -R ..., chmod -R ... command sequence. What is its equivalent on Windows?

share|improve this question
up vote 8 down vote accepted

NTFS is a bit more fine-grained than RWX, so for this example, I'm just resetting the ACLs to default. If you have a specific collection of ACEs, please add them to your question. Also, if the drive permissions themselves are mangled, we'd need to fix those as well.

Assuming the tree is rooted at D:\files:

REM Make local administrators group owner.
takeown /F D:\files /R /A /D Y

REM Reset ACLs to defaults.
icacls D:\files /reset /T /C /L /Q
share|improve this answer
Exactly this is what I wanted! Thank you! – peterh Jun 6 '14 at 16:14

Your Answer


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.