Link to home
Start Free TrialLog in
Avatar of Hani Naser
Hani NaserFlag for Canada

asked on

a command promt tool to modify permission on large number of folders using variables and batch file

This is windows 2003 file share server ; hosting the personal folder for all users. need to clean up the permission on all users using a command prompt to save time ; so NTFS permission is full control for domainadmins and modify for the %username% on their folders and subfolders
SOLUTION
Avatar of Lionel MM
Lionel MM
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
SOLUTION
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
ASKER CERTIFIED SOLUTION
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
Avatar of Hani Naser

ASKER

I was able to do that in 2 lines
cacls (foldername) /e /T /p SYSTEM:f (will grant system full control over username folder)
icacls (foldername) /grant:r  e-academy\username:(OI)(CI)M /t (will grant uusername modify permission over his folder) ..
username and foldername have the same name

I did not test the solutions above , but will give points to each equally
> I was able to do that in 2 lines
Without additional code, how does line 2 take care of your request to "...modify for the %username% on their folders and subfolders"?
also existing permissions remain since you did not remove inheritance from the parent folder(s)