Microsoft KB Archive/265360

= Using the Command Line to Edit Multiple Subdirectory Permissions =

Article ID: 265360

Article Last Modified on 11/1/2006

-

APPLIES TO


 * Microsoft Windows NT Server 4.0 Standard Edition

-



This article was previously published under Q265360



SUMMARY
This article explains how to use the command line utilities Subinacl.exe and Xcacls.exe to edit the directory permissions without replacing the existing permissions. The utilities Subinacl.exe and Xcacls.exe are included in the Windows NT Server 4.0 Resource Kit Supplement Three.



MORE INFORMATION
To change the permissions of multiple subdirectories from the command line or from a batch file, use the Subinacl.exe utility to change ownership of the subdirectories and then use the Xcacls.exe utility to change the directory permissions.

To change ownership of a directory, you can use the Subinacl.exe utility with the following syntax:

subinacl /object_type object_name /action=parameter

The following example illustrates how to use the Subinacl.exe utility to change ownership of a subdirectory:

subinacl /subdirectories c:\winnt\profiles\*.* /setowner=administrator

In this example, the parameters object_type object_name are specified by /subdirectories (the object type) and c:\winnt\profiles\*.* (the object name). Note that the command can modify multiple subdirectories (in this example, all subdirectories in the path c:\winnt\profiles). The action /setowner=administrator changes ownership of the specified subdirectories to the user account &quot;administrator&quot;.

After you have used the Subinacl.exe utility to change ownership of the subdirectories, you can use the Xcacls.exe utility to change permissions, using the following syntax:

xcacls filename /G user: permissions /E

The following example illustrates how to use the Xcacls.exe utility to change permissions:

xcacls c:\winnt\profiles\*.* /G administrator:F /E

In this example, the target subdirectories where permissions are modified are &quot;c:\winnt\profiles\*.*&quot;. The &quot;/G: administrator:F&quot; option is being used to grant the user account &quot;administrator&quot; full control permissions to the target subdirectories. The &quot;/E&quot; option is used to edit the existing access control list instead of replacing the existing permissions.

For additional information about the syntax and usage of the Subinacl.exe utility, type subinacl /help at the command line.

For additional information about the syntax and usage of the Xcacls.exe utility, refer to the Xcacls.doc file included in the Windows NT Server 4.0 Resource Kit Supplement Three.

Keywords: kbinfo KB265360

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.