Setting Folder Permissions from command prompt!

December 9, 2020
By shareef

CACLS: Change Access Control List

C:\> cacls foldername /e /p Username:F (Full Permission)

C:\> cacls foldername /D Username (to deny)

C:\> cacls foldername /e /p username:F (full control) (e:edit) (p:permission)

C:\> cacls “Foldername” /grant “Username”:F (full control)

C:\> cacls C:\Shared /e /p  Everyone:F (to create a permission on shared folder)

where /e is to preserve old permissions, /p is to add new permissions

F: stands for Full control

R: Read

W: Write

C: Change

If you don’t include /e the permissions assigned will be the only permissions on the file / directory.

To get the info of all files and folder inside the directory below is the PS command

PS C:\>Dir | Get-Acl (list all the permission on the shared folder)

To delete a share from command prompt –> net share Foldername /delete

Leave a Reply