Link to home
Start Free TrialLog in
Avatar of mikeydk
mikeydkFlag for Denmark

asked on

Set rights on folders, subfolders and files by commandline

Hey

Example:

D:\Users\Jon\

I would like to give jon@mydomain.com access to the Jon folder (security) - Give him rights to add folder, subfolders and files to the D:\Users\Jon... But Jon should not be able to delete the Jon folder.

Using icacls? or?

Thanks in advance

Mike
Avatar of btdownloads7
btdownloads7
Flag of United States of America image

You should definitely use icacls. If you just run that command without any parameters, it will give you all the possible options and some examples. It will look something like this:
icacls d:\users\jon /grant jon:(RC,WDAC,WO,S,AS,MA,GR,GW,GE,GA,RD,WD,AD,REA,WEA,X,RA,WA)

icacls d:\users\jon /grant jon:(DE,DC)

Open in new window


The first command basically give him full access without delete permissions, and the second specifically denies those delete permissions
Avatar of mikeydk

ASKER

Hey

How do I set the "Only files and subfolders"? (not only "this folder")

Mike
add the /T switch, which will propagate it into all the subfolders
ASKER CERTIFIED SOLUTION
Avatar of btdownloads7
btdownloads7
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial