title: icacls replace permissions drive root
body: <p>I'm operating on Windows 2012 R2, trying to use a batch file to manage my NTFS perms using icacls. The batch file is almost complete, then I'll be handing it off to someone with far less experience to manage, so I'm trying to make it as easy for him as possible.</p>
  
  <p>I want to automatically REPLACE all perms on the drive root (E:), in case they have been modified. The entire drive will be restored to a known configuration. Then I will set a few perms at the root (administrator, backup, etc.) that will propagate thru inheritance to all subdirectories. (probably these 2 operations are the same icacls call) There are many subdirectories, and different permissions will be applied to each of them. I have the subdirectory part of the batch file complete and successful.</p>
  
  <p>I have been unable to use icacls to REPLACE all permissions on the drive root. I have tried:</p>
  
  <pre><code>ICACLS.EXE "E:" /inheritance:r /grant:r "Administrators":(OI)(CI)F /T /Q
  </code></pre>
  
  <p>and</p>
  
  <pre><code>ICACLS.EXE "E:" /grant:r "Administrators":(OI)(CI)F /T /Q
  </code></pre>
  
  <p>both with no success. For testing, I added another group with access to the E:. After the batch file executed successfully to completion, that other group still had access; it was not removed from the ACL of the E:.</p>
  
  <p>Any ideas?</p>