China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-06-25 04:52
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Tool for setting advanced NTFS permissions: XCACLS.vbs View 7,911 Replies 44
Original Poster Posted 2006-12-22 14:59 ·  中国 四川 成都 教育网
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline
http://support.microsoft.com/kb/825751

Examples

The following Xcacls.vbs commands provide some examples of Xcacls.vbs usage:

xcacls.vbs c:\test\ /g domain\testuser1:f /f /t /e
This command edits existing permissions. It grants Domain\TestUser1 full control over all files under C:\Test, traverses subfolders under C:\Test, and then changes all found files. This command does not touch directories.

xcacls.vbs c:\test\ /g domain\testuser1:f /s /l "c:\xcacls.log"
This command replaces existing permissions. It grants Domain\TestUser1 full control over all subfolders under C:\Test and logs to C:\Xcacls.log. This command does not touch files and does not traverse directories.

xcacls.vbs c:\test\readme.txt /o "machinea\group1"
This command changes the owner of the readme file to group MachineA\Group1.

xcacls.vbs c:\test\badcode.exe /r "machinea\group1" /r "domain\testuser1"
This command revokes the permissions of MachineA\Group1 and Domain\TestUser1 on C:\Test\Badcode.exe.

xcacls.vbs c:\test\subdir1 /i enable /q
This command enables inheritance on folder C:\Test\Subdir1. This command suppresses any screen output.

xcacls.vbs \\servera\sharez\testpage.htm /p "domain\group2":14
This command remotely connects to \\ServerA\ShareZ using Windows Management Instrumentation (WMI). Then it obtains the local path for the share, under which it changes the permissions on Testpage.htm. It preserves the existing permissions of Domain\Group2 but adds permissions 1 (read data) and 4 (read extended attributes). This command drops other permissions on this file because the /e switch is not used.

xcacls.vbs d:\default.htm /g "domain\group2":f /server servera /user servera\admin /pass password /e
This command remotely connects to ServerA as ServerA\Admin using WMI, then grants full permissions to Domain\Group2 on Default.htm. The existing permissions of Domain\Group2 are lost, but other permissions on the file are retained.
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
+1 2009-01-07 19:26
Attachments
XCACLS.rar (22.21 KiB, Credits to download 1 pts, Downloads: 644)
Floor 2 Posted 2006-12-22 23:35 ·  中国 甘肃 兰州 电信
金牌会员
★★★★
Credits 4,103
Posts 1,744
Joined 2006-01-20 13:00
20-year member
UID 49241
Gender Male
From 甘肃.临泽
Status Offline
I still don't understand what the maximum function of this is compared to cacls?
Floor 3 Posted 2007-01-16 04:06 ·  中国 广东 广州 花都区 电信
新手上路
Credits 9
Posts 5
Joined 2007-01-15 04:19
19-year member
UID 76548
Gender Male
Status Offline
Not knowing code and English, but wanting to learn P processing, it's difficult, dizzy
Floor 4 Posted 2007-01-21 10:21 ·  中国 云南 昆明 电信
初级用户
Credits 57
Posts 29
Joined 2006-12-27 09:36
19-year member
UID 74694
Gender Male
Status Offline
Floor 5 Posted 2007-01-27 14:18 ·  中国 福建 泉州 电信
初级用户
Credits 24
Posts 13
Joined 2007-01-27 12:34
19-year member
UID 77855
Gender Male
Status Offline
Floor 6 Posted 2007-03-21 04:52 ·  中国 广东 佛山 顺德区 电信
新手上路
Credits 10
Posts 5
Joined 2007-03-21 02:48
19-year member
UID 82400
Gender Female
Status Offline
Why is this so complicated? Can you explain it more simply? I'm completely confused. It seems I still need to work hard to master this knowledge. :(
Floor 7 Posted 2007-03-21 09:29 ·  中国 河北 保定 联通
银牌会员
★★★
Credits 1,513
Posts 554
Joined 2005-12-30 00:50
20-year member
UID 48180
Gender Male
Status Offline
Floor 8 Posted 2007-03-24 10:13 ·  中国 福建 福州 电信
新手上路
Credits 2
Posts 1
Joined 2007-03-24 09:35
19-year member
UID 82766
Gender Male
Status Offline
Why can't I download directly? It's really frustrating. I still need points!
Floor 9 Posted 2007-05-05 12:00 ·  中国 安徽 合肥 庐江县 电信
新手上路
Credits 7
Posts 4
Joined 2007-05-03 18:45
19-year member
UID 87385
Gender Male
Status Offline
Floor 10 Posted 2007-05-17 19:17 ·  中国 四川 成都 联通
新手上路
Credits 2
Posts 1
Joined 2007-05-17 18:56
19-year member
UID 88851
Gender Male
Status Offline
Floor 11 Posted 2007-06-11 20:21 ·  中国 广东 佛山 禅城区 电信
新手上路
Credits 15
Posts 6
Joined 2007-06-10 17:25
19-year member
UID 90896
Gender Male
Status Offline
Can I just put it out directly?? I want to learn batch processing
But now I have no points. I'll give it to you later~~~~ ~!~
Floor 12 Posted 2007-06-17 12:10 ·  中国 黑龙江 齐齐哈尔 联通
新手上路
Credits 14
Posts 7
Joined 2007-06-17 10:49
19-year member
UID 91582
Gender Male
Status Offline
Is this benefit that there's no need for confirmation?
Floor 13 Posted 2007-07-08 10:01 ·  中国 广东 广州 海珠区 电信
新手上路
Credits 2
Posts 1
Joined 2006-11-03 00:30
19-year member
UID 69345
Gender Male
Status Offline
Looking for issues with batch processing to set permissions, thank you to the楼主.
Floor 14 Posted 2007-07-27 07:24 ·  中国 山东 济南 移动
新手上路
Credits 11
Posts 6
Joined 2007-07-27 06:42
18-year member
UID 94110
Gender Male
Status Offline
Develop good habits, give a thumbs-up after downloading
Floor 15 Posted 2007-07-27 09:41 ·  中国 湖南 岳阳 联通
新手上路
Credits 5
Posts 3
Joined 2007-07-27 09:05
18-year member
UID 94114
Gender Male
Status Offline
The following are some examples of Xcacls.vbs commands showing how to use Xcacls.vbs:

xcacls.vbs c:\test\ /g domain\testuser1:f /f /t /e
This command edits existing permissions. It grants Domain\TestUser1 full control over all files under C:\Test, traverses subfolders under C:\Test, and then changes all found files. This command does not touch directories.

xcacls.vbs c:\test\ /g domain\testuser1:f /s /l "c:\xcacls.log"
This command replaces existing permissions. It grants Domain\TestUser1 full control over all subfolders under C:\Test and logs to C:\Xcacls.log. This command does not touch files and does not traverse directories.

xcacls.vbs c:\test\readme.txt /o "machinea\group1"
This command changes the owner of the readme file to group MachineA\Group1.

xcacls.vbs c:\test\badcode.exe /r "machinea\group1" /r "domain\testuser1"
This command revokes the permissions of MachineA\Group1 and Domain\TestUser1 on C:\Test\Badcode.exe.

xcacls.vbs c:\test\subdir1 /i enable /q
This command enables inheritance on folder C:\Test\Subdir1. This command suppresses any screen output.

xcacls.vbs \\servera\sharez\testpage.htm /p "domain\group2":14
This command remotely connects to \\ServerA\ShareZ using Windows Management Instrumentation (WMI). Then it gets the local path for this share, and under this path, it changes the permissions on Testpage.htm. It preserves the existing permissions of Domain\Group2 as is, but adds permission 1 (read data) and permission 4 (read extended attributes). This command discards other permissions on this file because the /e switch is not used.

xcacls.vbs d:\default.htm /g "domain\group2":f /server servera /user servera\admin /pass password /e
This command uses WMI to remotely connect to ServerA as ServerA\Admin, and then grants full permissions on Default.htm to Domain\Group2. The existing permissions of Domain\Group2 are lost, but other permissions on the file are retained.
Forum Jump: