Article ID: 265360 - Last Review: November 1, 2006 - Revision: 1.1

Using the Command Line to Edit Multiple Subdirectory Permissions

System TipThis article applies to a different operating system than the one you are using. Article content that may not be relevant to you is disabled.
This article was previously published under Q265360
Expand all | Collapse all

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 "administrator".

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 "c:\winnt\profiles\*.*". The "/G: administrator:F" option is being used to grant the user account "administrator" full control permissions to the target subdirectories. The "/E" 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.

APPLIES TO
  • Microsoft Windows NT Server 4.0 Standard Edition
Keywords: 
kbinfo KB265360