icacls explainer and command builder
Paste what icacls prints for a file or folder, such as BUILTIN\Users:(OI)(CI)(RX), to read every entry in words: who, allowed or denied, which rights, inherited or not, and where it applies. Below it, build icacls commands that grant, deny or remove rights and turn inheritance on or off.
| Who | Allow or deny | Rights | Applies to | Inherited |
|---|
Build a command
Command
icacls <path>
How icacls shows an entry
icacls prints the path, then one entry per line: the account, a colon, and groups in parentheses. Inheritance flags come first, then the rights: a basic permission such as (M), or specific rights separated by commas. A deny entry starts with (DENY); an entry inherited from the parent folder carries (I). icacls keeps entries in this order: explicit denials, explicit grants, inherited denials, inherited grants.
The flags say where an entry applies, in the words of Microsoft's cacls reference:
| Flags | Applies to |
|---|---|
No output message | This folder only. |
(OI)(CI) | This folder, subfolders, and files. |
(OI)(CI)(IO) | Subfolders and files only. |
(CI)(IO) | Subfolders only. |
(OI)(IO) | Files only. |
| Flag | Meaning |
|---|---|
(I) | Inherited from the parent container. |
(OI) | Object inherit: files in this folder inherit the entry. Folders only. |
(CI) | Container inherit: subfolders inherit the entry. Folders only. |
(IO) | Inherit only: the entry passes to what is inside but does not apply to this folder itself. Folders only. |
(NP) | Do not propagate: the entry is inherited one level down but goes no further. Folders only. |
Rights
Basic permissions stand alone, without parentheses in a command:
| Right | Meaning |
|---|---|
N | No access |
F | Full access |
M | Modify access |
RX | Read and execute access |
R | Read-only access |
W | Write-only access |
D | Delete access |
Specific rights go in parentheses, separated by commas. The access mask decoder shows the bits behind them in a mask such as 0x1200A9.
| Right | Meaning |
|---|---|
DE | Delete |
RC | Read control (read permissions) |
WDAC | Write DAC (change permissions) |
WO | Write owner (take ownership) |
S | Synchronize |
AS | Access system security |
MA | Maximum allowed |
GR | Generic read |
GW | Generic write |
GE | Generic execute |
GA | Generic all |
RD | Read data/list directory |
WD | Write data/add file |
AD | Append data/add subdirectory |
REA | Read extended attributes |
WEA | Write extended attributes |
X | Execute/traverse |
DC | Delete child |
RA | Read attributes |
WA | Write attributes |
Before you run a command
- A SID goes after an asterisk:
*S-1-5-32-545. A name goes as it is. - Without
:r,/grantadds to the rights the account already has; with it, the new rights replace its explicit ones. /denyadds a deny entry and takes the same rights out of the account's explicit grants.- A deny with a basic permission can block more than its name says. In Raymond Chen's test,
icacls C:\test /deny Bob:Dmade a deny entry of DELETE and SYNCHRONIZE, while the same deny set in the Security dialog was DELETE alone. Specific rights in parentheses, such as(DE), name one right each. - Microsoft's command reference writes the inheritance switch as
/inheritancelevel; Microsoft's own examples elsewhere use/inheritance:r, the form this page writes.
Sources
- Switches, rights and inheritance flags: Microsoft's icacls command reference (windowsserverdocs at commit b640f2c), and its earlier icacls page for Windows Server 2012, which lists D for delete among the specific rights.
- Where each set of flags applies: the table of Microsoft's cacls command reference (the same repository and commit).
- How icacls prints deny and inherited entries, and the deny of D: Raymond Chen, The Old New Thing, 18 November 2019, I set the same ACL with the GUI and with icacls, yet the results are different.
- The /inheritance switch: an archived Microsoft blog post of 12 November 2010 on NTFS permissions in PowerShell, which uses ICACLS F:Folder /INHERITANCE:R.
- Microsoft's documentation is used under the Creative Commons Attribution 4.0 International licence (creativecommons.org/
licenses/ by/ 4.0/). The names and texts in the tables are Microsoft's; the meanings around them are written here in plain words.
More Windows tools
-
Windows error code lookup
Look up 0x80070005, 0xC000006D, 1603 or any other system error, HRESULT, NTSTATUS or bug check code.
-
Robocopy command builder
Build a robocopy command line, paste one to see what each switch does, and decode its exit codes.
-
Msiexec silent install builder
Build install, uninstall and repair commands and look up MSI exit codes.
-
PowerShell EncodedCommand decoder
Read the script inside an encoded PowerShell command, layer by layer, or encode one.
-
.reg file value decoder
hex(2), hex(7), hex(b) and dword values of a .reg file as text and numbers, and a value written as .reg lines.
-
Certificate decoder
Read a certificate, a chain or a request: names, dates, thumbprint, template and account SID.
-
Access mask decoder
Read an access mask such as 0x1200A9 or -1610612736 as file, registry or Active Directory rights.
-
KMS client keys and slmgr commands
Get the KMS client setup key (GVLK) of a Windows or Windows Server edition and the slmgr commands to activate it.
-
File hash checker
Work out the SHA-256, SHA-1, SHA-512 or MD5 hash of a file in your browser and compare it with the publisher's.
-
File type from its first bytes
What a file is by its first bytes, not its name: PDF, ZIP, Office, EXE or DLL with its CPU and bitness.
-
Zone.Identifier reader
The Mark of the Web on a downloaded file: its zone and address, and the commands that show and remove it.
-
Windows and IANA time zone names
Eastern Standard Time to America/New_York or America/Toronto and back, with tzutil, PowerShell and timedatectl.