Microsoft DOS cacls command

Quick links

About cacls
Availability
Cacls Syntax
Examples

About cacls

The cacls command enables a user to view and modify the ACLs of a file. If you're wanting to change the read/write, hidden, system settings of the file see the attrib command.

Availability

The cacls.exe command is an external command and is available in the below Microsoft operating systems.

Windows NT
Windows 2000
Windows XP
Windows Vista
Windows 7

Syntax

Displays or modifies access control lists (ACLs) of files

CACLS filename[/T] [/E] [/C] [/G user:perm] [/R user [...]]
 [/P user:perm [...]] [/D user [...]]
filenameDisplays ACLs.
/TChanges ACLs of specified files in the current directory and all subdirectories.
/EEdit ACL instead of replacing it.
/CContinue on access denied errors.
/G user:permGrant specified user access rights.
Perm can be: RRead
WWrite
CChange (write)
FFull control
/R userRevoke specified user's access rights (only valid with /E).
/P user:permReplace specified user's access rights.
Perm can be: NNone

R

Read
WWrite
CChange (write)
FFull control
/D userDeny specified user access.

Wildcards can be used to specify more that one file in a command. You can specify more than one user in a command.

Examples

cacls myfile.txt

Displays the ACLs for the myfile.txt file. Below is an example of what this may look like.

C:\WINNT\MYFILE.TXT BUILTIN\Users:R
BUILTIN\Power Users:C
BUILTIN\Administrators:F
NT AUTHORITY\SYSTEM:F

cacls myfile.txt /e /g mrhope:f

Grants the user "mrhope" full rights to the myfile.txt file. If user was to look at the ACLs again using the above command, they would now see that the mrhope user is in the list.