文章編號: 318754 - 上次校閱: 2006年6月6日 - 版次: 4.0 HOW TO: Use Xcacls.exe to modify NTFS permissions
在此頁中結論
This step-by-step article describes how to use the Extended Change Access Control List tool (Xcacls.exe) to modify and view NTFS permissions for files or folders. You can use Xcacls.exe to set all file-system security options that are accessible in Windows Explorer from the command line. Xcacls.exe does this by displaying and modifying the access control lists (ACLs) of files. Xcacls.exe is especially useful in unattended installations of Windows 2000 Professional or Windows 2000 Server. By using this tool, you can set the initial access rights for folders in which the operating system resides. When you distribute software to servers or workstations, Xcacls.exe also offers one-step protection against deletion of folders or files by users. The Xcacls.exe utility is included in the Windows 2000 Resource Kit. The following file is available for download from the Microsoft Download Center: 摺疊此圖像 ![]() Xcacls.exe syntax
xcacls file name [/T] [/E] [/C] [/G user:perm;spec] [/R user] [/P user:perm;spec [...]] [/D user [...]] [/Y]
where file name indicates the name of the file or folder to which the ACL or access control entry (ACE) is typically applied. All standard wildcard characters can be used. /T recursively walks through the current folder and all of its subfolders, applying the chosen access rights to the matching files or folders. /E edits the ACL instead of replacing it. For example, only the administrator will have access to the Test.dat file if you run the XCACLS test.dat /G Administrator:F command. All ACEs applied earlier are lost. /C causes Xcacls.exe to continue if an "access denied" error message occurs. If /C is not specified, Xcacls.exe stops on this error. /G user:perm;spec grants a user access to the matching file or folder.
/P user:perm;spec replaces access rights for user. The rules for specifying perm and spec are the same as for the /G option. See the "Xcacls.exe examples" section of this article. /D user denies user access to the file or directory. /Y disables confirmation when replacing user access rights. By default, CACLS asks for confirmation. Because of this feature, when CACLS is used in a batch routine, the routine stops responding until the right answer is entered. The /Y option was introduced to avoid this confirmation, so that Xcacls.exe can be used in batch mode. Use Xcacls.exe to view permissionsYou can also use Xcacls.exe to view permissions for a file or folder. For example, type xcacls C:\winnt at the command prompt, and then press ENTER. The following is a typical result:
c:\WINNT BUILTIN\Users:R
BUILTIN\Users:(OI)(CI)(IO)(special access:)
GENERIC_READ
GENERIC_EXECUTE
BUILTIN\Power Users:C
BUILTIN\Power Users:(OI)(CI)(IO)C
BUILTIN\Administrators:F
BUILTIN\Administrators:(OI)(CI)(IO)F
NT AUTHORITY\SYSTEM:F
NT AUTHORITY\SYSTEM:(OI)(CI)(IO)F
BUILTIN\Administrators:F
CREATOR OWNER:(OI)(CI)(IO)F
Xcacls.exe examplesExample 1Type XCACLS *.* /G administrator:RW /Y at the command prompt, and then press ENTER to replace the ACL of all files and folders in the current folder without scanning subfolders and without confirmation.Example 2The ACEs that are added to the folder in this example also inherit ACE for new files that are created in this folder. The command gives TestUser read, write, run, and delete rights on all new files created in this folder, but only read and write permissions on the folder itself. Type XCACLS *.* /G TestUser:RWED;RW /E at the command prompt, and then press ENTER.Example 3The following example grants read and write permissions on a folder without creating an inherit entry for new files. Therefore, in this example, new files that are created in this folder receive no ACE for TestUser. For existing files, an ACE with read permissions is created. Type XCACLS *.* /G TestUser:R;RW /E at the command prompt, and then press ENTER.NTFS permissions guidelinesThe following are guidelines for assigning NTFS permissions:
?考
For more information, click the following article numbers to view the articles in the Microsoft Knowledge Base:
245015?
(http://support.microsoft.com/kb/245015/
)
How to: Print folder and file permissions from one folder
135268?
(http://support.microsoft.com/kb/135268/
)
How to use CACLS.EXE in a batch file
這篇文章中的資訊適用於:
Microsoft及(或)其供應商不就任何在本伺服器上發表的文字資料及其相關圖表資訊的恰當性作任何承諾。所有文字資料及其相關圖表均以「現狀」供應,不負任何擔保責任。Microsoft及(或)其供應商謹此聲明,不負任何對與此資訊有關之擔保責任,包括關於適售性、適用於某一特定用途、權利或不侵權的明示或默示擔保責任。Microsoft及(或)其供應商無論如何不對因或與使用本伺服器上資訊或與資訊的實行有關而引起的契約、過失或其他侵權行為之訴訟中的特別的、間接的、衍生性的損害或任何因使用而喪失所導致的之損害、資料或利潤負任何責任。 | 其他資源 其他支援網站社群文章翻譯
|






Windows Live
Facebook
Twitter
Linkedin
Digg it
Yahoo
Delicious
StumbleUpon
Yammer
Reddit
Technorati
FriendFeed
Email

回此頁最上方