Article ID: 180464 - Last Review: February 27, 2007 - Revision: 2.2 How To Automate Folder PermissionsThis article was previously published under Q180464 On This PageSUMMARY
It is sometimes necessary to assign permissions to a folder so that a
particular User and the Administrators group can administer it, as in the
case of Users Home Directories.
MORE INFORMATION
Using the following three files (Addperm.cmd, Addperm2.cmd, and Yes.txt) you can add the Administrators Group and the User (whose logon name must be the same as the folder name) to the Access Control List (ACL) on the folder. This method only uses CACLS; no resource kit tools are needed.
NOTE: This article assumes you have a USERS share that contains individual directories. Either retype or copy and paste the following information into a file called Addperm.cmd in the root directory of the drive that has the USERS directory. Addperm.cmdAddperm2.cmdYes.txtThe third file is a little more difficult.Open a command prompt (Cmd.exe) and change directories to the root directory of the drive to which you have saved the other two files. Type the following:
COPY CON YES.TXT <press the enter key>
This creates a text file with the Y and ENTER needed to automate the
CACLS command.
y<press the enter key> <Press Control-Z to exit and save the file> To use the batch files type the following command: addperm c:\users
These batch files can easily be altered to add different permissions to the
directories. The /t switch instructs CACLS to change the permissions on all subfolders if the users folder has them.
If a user account does not match the name of the directory, you receive the error message:
No mapping between account names and security IDs was done.
APPLIES TO
| Article Translations
|

Back to the top
