




已阅读5页,还剩9页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
如何使用 Xcacls.exe 修改 NTFS 权限查看本文应用于的产品系统提示注意:本篇文章的内容适用于其他版本的 Windows (不包括您正在使用的版本) 。本篇文章的内容可能不适用您的电脑。浏览 Windows XP 帮助和支持中心本页 概要 o Xcacls.exe 语法 o 使用 Xcacls.exe 查看权限 o Xcacls.exe 示例 示例 1 示例 2 示例 3 o NTFS 权限原则 参考 展开全部 | 关闭全部 概要 本分步指南介绍如何使用扩展的更改访问控制列表工具 (Xcacls.exe) 修改和查看文件或文件夹的 NTFS 权限。 使用 Xcacls.exe 可以通过命令.本分步指南介绍如何使用扩展的更改访问控制列表工具 (Xcacls.exe) 修改和查看文件或文件夹的 NTFS 权限。 使用 Xcacls.exe 可以通过命令行设置所有可在 Windows 资源管理器中访问到的文件系统安全选项。Xcacls.exe 通过显示和修改文件的访问控制列表 (ACL) 完成此操作。 Xcacls.exe 在 Windows 2000 Professional 或 Windows 2000 Server 的无值守安装中特别有用。通过使用此工具,可以为操作系统所在的文件夹设置初始访问权限。在您将软件分发到服务器或工作站时,Xcacls.exe 还提供单步保护,以防止用户删除文件夹或文件。Xcacls.exe 实用工具包含在 Windows 2000 资源工具包 中。 可以从 Microsoft 下载中心下载以下文件:收起这个图片展开这个图片立即下载 XCacls_Installer.exe 软件包。 (/downloads/details.aspx?FamilyID=0ad33a24-0616-473c-b103-c35bc2820bda&DisplayLang=en) 回到顶端Xcacls.exe 语法xcacls 文件名 /T /E /C /G user:perm;spec /R 用户 /P user:perm;spec . /D 用户 . /Y 其中文件名表示 ACL 或访问控制项 (ACE) 通常应用于的文件或文件夹的名称。所有标准通配符均可使用。/T 递归检查当前文件夹及其所有子文件夹,对匹配的文件或文件夹应用所选的访问权限。 /E 编辑 ACL 而不替换它。例如,如果您运行 XCACLS test.dat /G Administrator:F 命令,则只有管理员拥有对 Test.dat 文件的访问权限。之前应用的所有 ACE 都会丢失。 /C 使 Xcacls.exe 在出现“拒绝访问”错误消息时继续执行。如果未指定 /C,则 Xcacls.exe 在出现此错误时停止执行。 /G user:perm;spec 授予用户对匹配文件或文件夹的访问权限。 perm(权限)变量对文件应用指定的访问权限,并代表文件夹的特殊文件访问权限掩码。perm 变量接受下列值: o R 读取 o C 更改(写入) o F 完全控制 o P 更改权限(特殊访问权限) o O 取得所有权(特殊访问权限) o X 执行(特殊访问权限) o E 读取(特殊访问权限) o W 写入(特殊访问权限) o D 删除(特殊访问权限) spec(特殊访问权限)变量仅应用于文件夹,它除了接受与 perm 相同的值以外,还接受以下特殊值: o T 未指定。为目录本身设置 ACE,而不指定应用于在该目录中创建的新文件的 ACE。至少存在一个要遵循的访问权限。分号 (;) 和 T 之间的项将被忽略。注意: 文件的访问权限选项(针对文件夹、特殊文件和文件夹访问)是完全相同的。有关这些选项的详细说明,请参阅 Windows 2000 操作系统的文档。 所有其他选项(它们也可以在 Windows 资源管理器中设置)都是基本访问权限的所有可能组合的子集。因此,不存在文件夹访问权限(如 LIST 或 READ)的特殊选项。/R 用户为指定用户调用所有访问权限。/P user:perm;spec 替换用户的访问权限。指定 perm 和 spec 的规则与 /G 选项相同。请参阅本文的“Xcacls.exe 示例”部分。/D 用户拒绝用户访问文件或目录。/Y 禁止在替换用户访问权限时出现确认提示。默认情况下,CACLS 要求确认。由于存在此功能,在批处理例程中使用 CACLS 时,例程将停止响应并等待输入正确答案。引入 /Y 选项后可消除此确认,从而可以在批处理模式下使用 Xcacls.exe。 回到顶端使用 Xcacls.exe 查看权限Xcacls.exe 还可用于查看文件或文件夹的权限。例如,在命令提示符处键入 xcacls C:winnt,然后按 Enter。下面是典型结果: c:WINNT BUILTINUsers:RBUILTINUsers:(OI)(CI)(IO)(special access:)GENERIC_READGENERIC_EXECUTEBUILTINPower Users:CBUILTINPower Users:(OI)(CI)(IO)CBUILTINAdministrators:FBUILTINAdministrators:(OI)(CI)(IO)FNT AUTHORITYSYSTEM:FNT AUTHORITYSYSTEM:(OI)(CI)(IO)FBUILTINAdministrators:FCREATOR OWNER:(OI)(CI)(IO)F这些 ACL 标志具有下列含义: IO:仅继承 此标志表示此 ACE 不应用于当前对象。 CI:容器继承 此标志表示从属容器将继承此 ACE。 OI:对象继承 此标志表示从属文件将继承该 ACE。 NP:不传播 此标志表示从属对象不继续传播继承的 ACE。每行末尾的字母表示权限。例如: F:完全控制 C:更改 W:写入回到顶端Xcacls.exe 示例示例 1在命令提示符下键入 XCACLS *.* /G administrator:RW /Y,然后按 Enter 以替换当前文件夹中所有文件和文件夹的 ACL,而不扫描子文件夹且不进行确认。 示例 2在本示例中,添加到文件夹的 ACE 还将继承在此文件夹中创建的新文件的 ACE。该命令授予 TestUser 对此文件夹中的所有新建文件的读取、写入、运行和删除权限,但只授予对文件夹本身的读写权限。在命令提示符下键入 XCACLS *.* /G TestUser:RWED;RW /E,然后按 Enter。 示例 3下面的示例将授予对文件夹的读写权限,而不为新文件创建继承项。因此,在本示例中,此文件夹中的新建文件不会收到 TestUser 的 ACE。对于现有文件,将创建具有读取权限的 ACE。在命令提示符下键入 XCACLS *.* /G TestUser:R;RW /E,然后按 Enter。回到顶端NTFS 权限原则下面是分配 NTFS 权限的原则: 使用 NTFS 权限控制对文件和文件夹的访问。 将权限分配给组而不是单独用户。 NTFS 文件权限优先于 NTFS 文件夹权限。 管理员以及文件或文件夹的所有者控制可为该对象设置的权限。 在更改文件夹权限时,应了解服务器上安装的程序。程序会创建自己的文件夹并打开“允许从父系来的继承权限传播到这个对象”设置。如果更改了父文件夹中的权限,则这些更改可能会导致程序中出现问题。警告:请记住,许多文件和文件夹通过继承接收权限。因此,在您认为只是更改了一个文件夹时,您可能更改了其他更多内容。如何使用 Xcacls.vbs 修改 NTFS 权限Microsoft 以 Microsoft Visual Basic 脚本 (Xcacls.vbs) 的形式提供了 Extended Change Access Control List(扩展更改访问控制列表)工具 (Xcacls.exe) 的更新版本。本文分步介绍如何使用 Xcacls.vbs 脚本修改和查看文件或文件夹的 NTFS 文件系统权限。 可以从命令行使用 Xcacls.vbs 设置所有可在 Microsoft Windows 资源管理器中访问的文件系统安全选项。Xcacls.vbs 可显示和修改文件的访问控制列表 (ACL)。注意:Xcacls.vbs 只与 Microsoft Windows 2000、Microsoft Windows XP 和 Microsoft Windows Server 2003 兼容。Microsoft 不支持 Xcacls.vbs。回到顶端设置和使用 Xcacls.vbs要设置和使用 Xcacls.vbs,请按照下列步骤操作: 1. 从以下 Microsoft 网站获得 Xcacls.vbs 的最新版本: /download/f/7/8/f786aaf3-a37b-45ab-b0a2-8c8c18bbf483/XCacls_Installer.exe (/download/f/7/8/f786aaf3-a37b-45ab-b0a2-8c8c18bbf483/xcacls_installer.exe) 2. 双击“Xcacls_Installer.exe”。当提示您提供放置提取文件的位置时,请指定一个位于计算机的搜索路径设置中的文件夹(如 C:Windows)。 3. 将默认脚本引擎从 Wscript 更改为 Cscript。(Xcacls.vbs 脚本最适合在 Cscript 下运行。)为此,请在命令提示符下键入以下内容,然后按 Enter: cscript.exe /h:cscript注意:将默认脚本引擎更改为 Cscript 只影响脚本向屏幕写入的方式。Wscript 根据“确定”对话框分别写入每一行。Cscript 将每一行写入命令窗口。如果您不想更改默认脚本引擎,则必须使用以下命令运行脚本 cscript.exe xcacls.vbs但是,如果将默认脚本更改为 Cscript,则可以使用以下命令运行该脚本: xcacls.vbs. 4. 要查看 Xcacls.vbs 的命令语法,请在命令提示符处键入下面的命令: xcacls.vbs /?Xcacls.vbs 命令的语法下面 xcacls.vbs /? 命令的输出描述了 Xcacls.vbs 命令的语法:Usage:XCACLS filename /E /G user:perm;spec . /R user . /F /S /T /P user:perm;spec . /D user:perm;spec . /O user /I ENABLE/COPY/REMOVE /N /L filename /Q /DEBUG filename Required If used alone, it displays ACLs. (Filename can be a filename, directory name or wildcard characters and can include the whole path. If path is missing, it is assumed to be under the current directory.) Notes: - Put filename in quotes if it has spaces or special characters such as &, $, #, etc. - If filename is a directory, all files and subdirectories under it will NOT be changed unless the /F or S is present. /F Used with Directory or Wildcard This will change all files under the inputted directory but will NOT traverse subdirectories unless /T is also present. If filename is a directory, and /F is not used, no files will be touched. /S Used with Directory or Wildcard This will change all subfolders under the inputted directory but will NOT traverse subdirectories unless /T is also present. If filename is a directory, and /S is not used, no subdirectories will be touched. /T Used only with a Directory Traverses each subdirectory and makes the same changes. This switch will traverse directories only if the filename is a directory or is using wildcard characters. /E Edit ACL instead of replacing it. /G user:GUI Grant security permissions similar to Windows GUI standard (non-advanced) choices. /G user:Perm;Spec Grant specified user access rights. (/G adds to existing rights for user) User: If User has spaces in it, enclose it in quotes. If User contains #machine#, it will replace #machine# with the actual machine name if it is a non-domain controller, and replace it with the actual domain name if it is a domain controller. New to 3.0: User can be a string representing the actual SID, but MUST be lead by SID# Example: SID#S-1-5-21-2127521184-160. (SID string shown has been shortened) (If any user has SID# then globally all matches must match the SID (not name) so if your intention is to apply changes to all accounts that match DomainUser then do not specify SID# as one of the users.) GUI: Is for standard rights and can be: Permissions. F Full control M Modify X read and eXecute L List folder contents R Read W Write Note: If a ; is present, this will be considered a Perm;Spec parameter pair. Perm: Is for Files Only and can be: Permissions. F Full control M Modify X read and eXecute R Read W Write Advanced. D Take Ownership C Change Permissions B Read Permissions A Delete 9 Write Attributes 8 Read Attributes 7 Delete Subfolders and Files 6 Traverse Folder / Execute File 5 Write Extended Attributes 4 Read Extended Attributes 3 Create Folders / Append Data 2 Create Files / Write Data 1 List Folder / Read Data Spec is for Folder and Subfolders only and has the same choices as Perm. /R user Revoke specified users access rights. (Will remove any Allowed or Denied ACLs for user.) /P user:GUI Replace security permissions similar to standard choices. /P user:perm;spec Replace specified users access rights. For access right specification see /G option. (/P behaves like /G if there are no rights set for user.) /D user:GUI Deny security permissions similar to standard choices. /D user:perm;spec Deny specified user access rights. For access right specification see /G option. (/D adds to existing rights for user.) /O user Change the Ownership to this user or group. /I switch Inheritance flag. If omitted, the default is to not touch Inherited ACLs. Switch can be: ENABLE - This will turn on the Inheritance flag if it is not on already. COPY - This will turn off the Inheritance flag and copy the Inherited ACLs into Effective ACLs. REMOVE - This will turn off the Inheritance flag and will not copy the Inherited ACLs. This is the opposite of ENABLE. If switch is not present, /I will be ignored and Inherited ACLs will remain untouched. /L filename Filename for Logging. This can include a path name if the file is not under the current directory. File will be appended to, or created if it does not exit. Must be Text file if it exists or error will occur. If filename is omitted, the default name of XCACLS will be used. /Q Turn on Quiet mode. By default, it is off. If it is turned on, there will be no display to the screen. /DEBUG Turn on Debug mode. By default, it is off. If it is turned on, there will be more information displayed and/or logged. Information will show Sub/Function Enter and Exit as well as other important information. /SERVER servername Enter a remote server to run script against. /USER username Enter Username to impersonate for Remote Connections (requires PASS switch). Will be ignored if it is for a Local Connection. /PASS password Enter Password to go with USER switch (requires USER switch).Wildcard characters can be used to specify more than one file in a command, such as: * Any string of zero or more characters ? Any single characterYou can specify more than one user in a command.You can combine access rights.使用 Xcacls.vbs 查看权限Xcacls.vbs 还可用于查看文件或文件夹的权限。 例如,如果您有一个名为 C:Test 的文件夹,在命令提示符处键入以下命令以查看文件夹权限,然后按 Enter: xcacls.vbs c:test下面的示例是一个典型结果: C:XCACLS.VBS c:testMicrosoft (R) Windows Script Host 5.6版权所有 (C) Microsoft Corporation 1996-2001。保留所有权利。Starting XCACLS.VBS (Version: 3.4) Script at 6/11/2003 10:55:21 AMStartup directory:C:testArguments Used:Filename = c:test*Directory:C:testPermissions:Type Username Permissions InheritanceAllowed BUILTINAdministrators Full Control This Folder, SubfoldeAllowed NT AUTHORITYSYSTEM Full Control This Folder, SubfoldeAllowed Domain1User1 Full Control This Folder OnlyAllowed CREATOR OWNER Special (Unknown) Subfolders and FilesAllowed BUILTINUsers Read and Execute This Folder, SubfoldeAllowed BUILTINUsers Create Folders / Appe This Folder and SubfoAllowed BUILTINUsers Create Files / Write This Folder and SubfoNo Auditing setOwner:Domain1User1注意:在该示例中,xcacls.vbs c:test 命令的输出与显示在图形用户界面 (GUI) 的文本一致。命令窗口的一些文字不完整。输出还给出了脚本的版本、启动目录和使用的参数。 您还可以使用通
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 投标签到登记表
- DBJ04-T496-2025 《工程造价咨询档案管理标准》
- 人教版(2019)必修 第一册 Travelling around Reading and thinking课件(内嵌视频)
- 云南省玉溪市2022-2023学年高二下学期化学期末考试试题(含答案)
- 汽车传感器与检测技术课件:ABS灯亮-轮速传感器故障
- 园林公司项目管理制度
- 海南“滨海贵族温泉花园”项目可行性研究报告119p
- 介绍庙会民俗活动方案
- 物理中考一轮复习教案 第二十三讲 动能势能机械能、内能热传递
- 介绍马戏活动方案
- 节气科学知识
- 光伏工商业培训课件
- 2024年湖北新华书店有限公司招聘笔试参考题库含答案解析
- 宫颈炎护理查房
- 发展汉语初级读写第一课知识介绍
- 基于大数据的驾驶员安全驾驶行为分析与应用
- 基于System-View的巴克码识别器的课程设计报告
- 退伍军人登记表
- 广东检测鉴定协会非金属考试试题
- 马克思主义基本原理智慧树知到课后章节答案2023年下湖南大学
- 中学信息考试突发事件应急处置预案
评论
0/150
提交评论