概要
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 的最新版本:
http://download.microsoft.com/download/f/7/8/f786aaf3-a37b-45ab-b0a2-8c8c18bbf483/XCacls_Installer.exe (http://download.microsoft.com/download/f/7/8/f786aaf3-a37b-45ab-b0a2-8c8c18bbf483/xcacls_installer.exe)
XCACLS.vbs直接下載http://xiazai.jb51.net/201008/tools/XCACLS.rar
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
新聞熱點
疑難解答
圖片精選