title: Deny all folders permission from all users/administrators via CMD/Batch in Windows 7/8/10
body: <p>I need to deny all folder permissions for all users, include administrators and others groups via batch file.</p>
  
  <p>I found two topics about this, but i can't solve my problem</p>
  
  <p><a href="https://stackoverflow.com/questions/25746550/icacls-deny-everyone-directory-delete-permission">icacls Deny Everyone Directory Delete Permission</a></p>
  
  <p><a href="https://stackoverflow.com/questions/2928738/how-to-grant-permission-to-users-for-a-directory-using-command-line-in-windows">How to grant permission to users for a directory using command line in Windows?</a></p>
  
  <p>This command works
  <code>icacls D:\Desktop\test /deny Administrator:(OI)(CI)(DE,DC)</code>
  , but this command affects only special permissions:</p>
  
  <p><a href="https://i.stack.imgur.com/PvDl3.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PvDl3.jpg" alt="enter image description here"></a></p>
  
  <p>But I need to deny all others permissions like image:</p>
  
  <p><a href="https://i.stack.imgur.com/39tSm.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/39tSm.jpg" alt="enter image description here"></a></p>
  
  <p>I need to deny all permissions to all all users (administrators, system, and others) via batch, so that nobody can access this folder, not even the system, or the creator of the folder.</p>