MS-DOS and Windows command line calcs command
Updated:
12/30/2021
past
Reckoner Hope
The
cacls
control enables a user to view and change an ACL of a file.
Tip
If y’all want to change the read/write, hidden, system settings of the file run across the attrib control.
Notation
Cacls is now deprecated. If yous are using Windows 7 or later, use icacls instead.
Availability
Cacls is an external command and is bachelor for the post-obit Microsoft operating systems every bit cacls.exe.
- Windows NT
- Windows 2000
- Windows XP
- Windows Vista
- Windows 7
- Windows viii
- Windows x
- Windows 11
Cacls syntax
- Windows Vista and later syntax
- Windows XP and earlier syntax
Windows Vista and later syntax
Displays or modifies ACLs (admission control lists) of files.
CACLS file proper name [/T] [/Thou] [/50] [/S[:SDDL]] [/East] [/C] [/Thou user:perm] [/R user [...]] [/P user:perm [...]] [/D user [...]]
file name | The name of the file to query for ACL data. | ||||||||||
/T | Changes ACLs of specified files in the current directory and all subdirectories. | ||||||||||
/Chiliad | Changes ACLs of volumes mounted to a directory. | ||||||||||
/L | Work on the symbolic link itself versus the target. | ||||||||||
/South | Displays the SDDL cord for the DACL. | ||||||||||
/S:SDDL | Replaces the ACLs with those specified in the SDDL string (not valid with /Eastward, /Grand, /R, /P, or /D). | ||||||||||
/E | Edit ACL instead of replacing information technology. | ||||||||||
/C | Continue on admission denied errors. | ||||||||||
/G user:perm |
Grant access rights to user. Perm can be:
|
||||||||||
/R user | Revoke specified user’south admission rights (simply valid with /E). | ||||||||||
/P user:perm |
Replace the admission rights of user. Perm can be:
|
||||||||||
/D user | Deny specified user access. |
Abbreviations:
CI
– Container inherit. The ACE volition be inherited by directories.
OI
– Object inherit. The ACE will be inherited past files.
IO
– Inherit but. The ACE does not apply to the current file or directory.
ID
– Inherited. The ACE was inherited from the parent directory’s ACL.
Windows XP and earlier syntax
Displays or modifies ACLs (admission control lists) of files.
CACLS file proper name [/T] [/E] [/C] [/G user:perm] [/R user [...]] [/P user:perm [...]] [/D user [...]]
file proper name | The name of the file to query for ACL data. | ||||||||
/T | Changes ACLs of specified files in the electric current directory and all subdirectories. | ||||||||
/E | Edit ACL instead of replacing it. | ||||||||
/C | Continue on admission denied errors. | ||||||||
/Grand user:perm |
Grant access rights to user. Perm can exist:
|
||||||||
/R user | Revoke specified user’s access rights (but valid with /East). | ||||||||
/P user:perm |
Replace the admission rights of user. Perm tin be:
|
||||||||
/D user | Deny specified user access. |
Wildcards can specify more than 1 file in a control. You tin can specify more than one user in a command.
Cacls examples
cacls myfile.txt
The command above displays the ACLs for the file
myfile.txt. Example output:
READ_CONTROL FILE_READ_EA FILE_EXECUTE FILE_DELETE_CHILD BUILTIN\Administrators:F Calculator-Proper noun\None:R NT AUTHORITY\SYSTEM:(special admission:) READ_CONTROL SYNCHRONIZE FILE_GENERIC_READ FILE_GENERIC_WRITE BUILTIN\Administrators:(special access:) READ_CONTROL SYNCHRONIZE FILE_GENERIC_READ Everyone:R
cacls myfile.txt /e /g mrhope:f
The command above grants the user
mrhope
full rights (f) to the file
myfile.txt. If the ACL for the file is and so listed (for example, using the commencement command in a higher place), the user
mrhope
appears in the list.
Source: https://www.computerhope.com/cacls.htm