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-08-08 23:18
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Help] How to repair the access permissions for all drives View 649 Replies 6
Original Poster Posted 2008-06-02 20:35 ·  中国 广东 潮州 电信
新手上路
Credits 15
Posts 6
Joined 2007-09-07 12:05
18-year member
UID 96784
Gender Male
Status Offline
Changed all drives' permissions to completely deny access

for %%i in (c d e f g h i j k l m n o p q r s t u v w x y z) do (echo.y|cacls %%i:\ /p everyone:n >nul)

Help, how do I repair the access permissions for all drives
Floor 2 Posted 2008-06-02 20:38 ·  中国 山东 淄博 联通
银牌会员
★★★
Credits 1,604
Posts 646
Joined 2008-04-13 23:39
18-year member
UID 115804
Gender Male
Status Offline
I'm not familiar with the cacls command...

But looking at the code you gave, then to restore access permissions it should definitely be echo.y|cacls %%i:\ /p everyone:y >nul~
心绪平和,眼藏静谧,无比安稳的火... Purification of soul...Just a false...^_^
Floor 3 Posted 2008-06-02 23:40 ·  中国 湖南 株洲 电信
金牌会员
★★★★
永远的学习者
Credits 3,105
Posts 1,276
Joined 2008-03-08 13:00
18-year member
UID 112398
Gender Male
Status Offline

CACLS filename ]
] ]
filename Displays ACL.
/T Changes the ACL of the specified file in the current
directory and all its subdirectories.
/E Edits the ACL without replacing it.
/C Continues when access denied errors occur.
/G user:perm Grants access rights to the specified user.
Perm can be: R Read
W Write
C Change (write)
F Full control
/R user Revokes access rights for the specified user
(valid only when used with /E).
/P user:perm Replaces access rights for the specified user.
Perm can be: N None
R Read
W Write
C Change (write)
F Full control
/D user Denies access to the specified user.
Wildcards can be used in the command to specify multiple files.
Multiple users can also be specified in the command.
批处理之家新域名:www.bathome.net
Floor 4 Posted 2008-06-02 23:43 ·  美国 惠普HP
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
Floor 5 Posted 2008-06-02 23:46 ·  中国 湖南 株洲 电信
金牌会员
★★★★
永远的学习者
Credits 3,105
Posts 1,276
Joined 2008-03-08 13:00
18-year member
UID 112398
Gender Male
Status Offline
Originally posted by HAT at 2008-6-2 23:43:
for %%i in (c d e f g h i j k l m n o p q r s t u v w x y z) do (echo.y|cacls %%i:\ /p everyone:f >nul)

Brother, this sets all users' permissions on all drives to full control, but that may not be what the OP means, right? He wants to restore the original permissions, like user A having full control, user B being read-only, user C being write...
批处理之家新域名:www.bathome.net
Floor 6 Posted 2008-06-02 23:52 ·  中国 山东 淄博 联通
银牌会员
★★★
Credits 1,604
Posts 646
Joined 2008-04-13 23:39
18-year member
UID 115804
Gender Male
Status Offline
- -|||| I completely misunderstood it.... n is short for none, I thought it meant no
心绪平和,眼藏静谧,无比安稳的火... Purification of soul...Just a false...^_^
Floor 7 Posted 2008-06-03 00:10 ·  中国 重庆 九龙坡区 电信
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
Originally posted by zw19750516 at 2008-6-2 11:46 PM:

Brother, this sets all users' permissions on all drives to full control, but that may not be what the OP means, right? He wants to restore the original permissions, like user A having full control, user B being read-only, user C being write...

Once the ACLs are gone, how can you restore the original permissions? You can only rely on memory and write a few more cacls commands, I guess.
Forum Jump: