Преобразование этих команд chmod в cacls?

705
space_food_

Возможно, кто-то может мне помочь. Я хотел бы преобразовать следующие команды chmod для использования в Windows 7, но моего понимания не хватает.

/bin/chmod -R u+w,go-w,a+r somedirectory /bin/chmod a+x anotherdirectory 

Спасибо большое

0

1 ответ на вопрос

0
Dean Spicer

Here are a couple of examples taken from the cacls manual/help page.

Grant full control to User "Dean" to all files and subdirectories:

cacls somedirectory /e /t /p Dean:f 

Add Read-Only permission to a single file

CACLS myfile.txt /E /G "Power Users":R 

Add Full Control permission to a second group of users

CACLS myfile.txt /E /G "FinanceUsers":F 

Now revoke the Read permissions from the first group

CACLS myfile.txt /E /R "Power Users" 

Now give the first group Full-control:

CACLS myfile.txt /E /G "Power Users":F 

Give the Finance group Full Control of a folder and all sub folders

CACLS c:\docs\work /E /T /C /G "FinanceUsers":F 

It looks like the "/t" does the recursion into all files and subdirectories, and "/e" edits instead of replaces the access control list (permissions). You can use multiple options per command but I have been having trouble changing everything at once. Cacls looks like it wants specific groups and users as opposed to the o,g,a options.

Here's some more info from "cacls /?":

 /G user:perm Grant specified user access rights. Perm can be: R Read W Write C Change (write) F Full control /R user Revoke specified user's access rights (only valid with /E). /P user:perm Replace specified user's access rights. Perm can be: N None R Read W Write C Change (write) F Full control 

Похожие вопросы