Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You can use the <a href="http://technet.microsoft.com/en-us/library/cc753525.aspx" rel="nofollow"><code>icacls</code></a> command to display or modify permissions on any given file or folder. For adding a missing group to a folder, something like this should work:</p> <pre><code>Set sh = CreateObject("WScript.Shell") fldr = "C:\some\folder" group = "TA\admin" rc = sh.Run("%COMSPEC% /c icacls """ &amp; fldr &amp; """ | find /i """ &amp; group _ &amp; """", 0, True) If rc &lt;&gt; 0 Then sh.Run "icacls """ &amp; fldr &amp; """ /grant " &amp; group &amp; ":F" </code></pre> <p>For listing the permissions on a folder tree something like <a href="http://www.coopware.in2.info/_ntfsacl.htm" rel="nofollow"><code>ntfsacls</code></a> or <a href="http://www.planetcobalt.net/sdb/auditacls.shtml" rel="nofollow"><code>AuditACLs.vbs</code></a> might be a better choice, though.</p> <hr> <p><code>icacls</code> usage example:</p> <pre><code>icacls "C:\some\folder" /grant FOO\bar:(OI)(CI)RX Administrators:(OI)(CI)F </code></pre> <p>This will grant the group "bar" of the domain "FOO" read/execute permissions and the local group "Administrators" full access to the folder "C:\some\folder" and all of its subfolders that are configured to inherit permissions from their parent.</p> <p>To run this command from VBScript with variables for the folder and groups you'd do this:</p> <pre><code>fldr = "C:\some\folder" groupA = "FOO\bar" groupB = "Administrators" Set sh = CreateObject("WScript.Shell") sh.Run "icacls """ &amp; fldr &amp; """ /grant " &amp; groupA &amp; ":(CI)(OI)RX " _ &amp; groupB &amp; ":(CI)(OI)F" </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload