How To Use The Icacls Command In Windows (2027)
Icacls shows or changes who can open, edit or delete a file or folder from the command line.
The basic grant form is icacls <path> /grant <user>:F, and /T carries the change into every subfolder.
Every option below comes from Microsoft’s icacls reference, which lists Windows 11 and Windows 10 as supported.
Table of Contents
- Icacls quick answers
- What icacls does
- Open Command Prompt as administrator
- The icacls syntax
- Icacls options at a glance
- Grant permissions to a user
- Basic permission codes
- Inheritance flags for folders
- Advanced permission codes
- Deny, remove and reset
- Save and restore permissions
- Use a SID instead of a name
- Set an integrity level
- Find and check files
- Mistakes that stop icacls from working
- Change a folder’s permissions step by step
- Related guides
- Official sources
- More Windows guides
Icacls quick answers
| I want to | Type this |
|---|---|
| Give a user full access | icacls <path> /grant <user>:F |
| Give a user modify access | icacls <path> /grant <user>:M |
| Block a user | icacls <path> /deny <user>:F |
| Remove every entry for a user | icacls <path> /remove <user> |
| Change the owner | icacls <path> /setowner <user> |
| Reset permissions to the inherited defaults | icacls <path> /reset |
| Save permissions to a file | icacls <path> /save perms.txt /T |
Replace the placeholders with your own path and account name, and put quotes around any path with a space.
What icacls does
Microsoft says icacls displays or modifies discretionary access control lists (DACLs) on files, and applies stored DACLs to files in a directory.
A DACL is the list of who may do what to an item.
The command replaces the older cacls command, which Microsoft marks as deprecated.
Open Command Prompt as administrator
- Press the Windows key and type cmd.
- Right-click Command Prompt and choose Run as administrator.
- Type your icacls command and press Enter.
The steps for an elevated window are in how to open Terminal as administrator.
The icacls syntax
Microsoft gives three forms: one to save, own, find, verify or reset, one to grant, deny or remove, and one to substitute or restore.
The first form is icacls name [/save aclfile] [/setowner user] [/findsid Sid] [/verify] [/reset] [/T] [/C] [/L] [/Q].
The second form is icacls name [/grant[:r] Sid:perm[...]] [/deny Sid:perm [...]] [/remove[:g|:d]] Sid[...]]] [/setintegritylevel Level:policy[...]] [/T] [/C] [/L] [/Q].
The third form is icacls directory [/substitute SidOld SidNew [...]] [/restore aclfile] [/C] [/L] [/Q].
Icacls options at a glance
| Option | What it does |
|---|---|
/T | Runs the operation on all matching files in the current directory and its subdirectories. |
/C | Continues even if file errors occur, and still shows the error messages. |
/L | Works on a symbolic link instead of its destination. |
/Q | Suppresses success messages. |
/save <ACLfile> | Stores the DACLs of all matching files for later use with /restore. |
/setowner <user> | Changes the owner of all matching files to the user. |
/findsid <sid> | Finds files whose DACL explicitly mentions the SID. |
/verify | Finds files with ACLs that are not canonical or have inconsistent lengths. |
/reset | Replaces ACLs with the default inherited ACLs. |
Grant permissions to a user
Use /grant followed by the account, a colon and the permission code.
Microsoft’s example gives User1 Delete and Write DAC rights on a file with icacls test1 /grant User1:(d,wdac).
Without :r the permission is added to any explicit permissions already granted, and with /grant:r it replaces them.
- Open an elevated Command Prompt.
- Run
icacls "C:\Data" /grant "User1:(OI)(CI)M"with your own folder and account. - Add /T if you want the change applied to existing files and subfolders.
That folder command is built from Microsoft’s documented modify code and inheritance flags rather than copied from an example.
Basic permission codes
| Code | Access it gives |
|---|---|
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. |
Pick the smallest code that does the job, such as RX for people who only need to open files.
Inheritance flags for folders
| Flag | Meaning |
|---|---|
(I) | The entry was inherited from the parent container. |
(OI) | Objects in this container inherit the entry, and it applies only to directories. |
(CI) | Containers in this parent container inherit the entry, and it applies only to directories. |
(IO) | Inherit only: the entry does not apply to the object itself, only to what it passes down. |
(NP) | Do not propagate: the entry does not pass on to nested containers. |
Putting (OI)(CI) before the permission code is the usual way to make new files and subfolders pick up a folder’s permission.
Advanced permission codes
Advanced rights go in parentheses as a comma-separated list, as in (d,wdac).
DEis Delete andRCis Read control.WDACchanges permissions andWOtakes ownership.RDreads data or lists a directory andWDwrites data or adds a file.ADappends data or adds a subdirectory, andXexecutes or traverses.RAreads attributes andWAwrites attributes.
Deny, remove and reset
Microsoft says /deny adds an explicit deny entry for the stated permissions and removes the same permissions from any explicit grant.
The /remove option deletes every occurrence of a SID from the DACL, and :g or :d limits it to granted or denied entries.
The /reset option replaces the ACLs with the default inherited ones.
Microsoft lists the order Windows keeps entries in as explicit denials, explicit grants, inherited denials, then inherited grants.
Save and restore permissions
Run icacls c:\windows\* /save aclfile /t to store the permissions of everything under a folder, which is Microsoft’s own example.
Restore them with icacls c:\windows\ /restore aclfile.
Saving a copy before a large change gives you a way back if the new permissions lock someone out.
Use a SID instead of a name
Microsoft says SIDs can be friendly names or numerical values, and numerical ones need an asterisk in front.
Its example is icacls TestFile /grant *S-1-1-0:(d,wdac).
Set an integrity level
The /setintegritylevel option adds an integrity entry to all matching files, with the level given as L for low, M for medium or H for high.
Microsoft’s example is icacls "myDirectory" /setintegritylevel (CI)(OI)H, which makes files and subdirectories inherit a high level.
Inheritance flags in front of the level apply only to directories.
Find and check files
Use /findsid to list files whose DACL explicitly names a security identifier, and /verify to find files with ACLs that are not canonical.
Microsoft also documents /inheritancelevel with e to enable inheritance, d to disable it and copy the entries, and r to disable it and remove only inherited entries.
Mistakes that stop icacls from working
- Running it in a window that is not elevated.
- Leaving out the colon between the account and the permission code.
- Forgetting
/T, so existing files below the folder keep their old permissions. - Using
/denyon a broad group, since explicit denies come first in the order. - Changing permissions on system folders without a saved copy.
If the error says you do not own the item, take ownership first with the takeown command.
Change a folder’s permissions step by step
- Open an elevated Command Prompt.
- Save the current permissions with
icacls <folder> /save perms.txt /T. - Run
icacls <folder> /grant <user>:(OI)(CI)Mto give modify access. - Open the folder as that user and confirm the access works.
- If something goes wrong, run
icacls <parent folder> /restore perms.txt.
Related guides
For the Explorer route to the same problem, see how to fix folder access denied in Windows 11.
For changing file flags instead of permissions, see the attrib command guide.
Official sources
The options, codes and examples come from Microsoft’s icacls reference.
More Windows guides
- How To Use The Takeown Command In Windows (2027)
- How To Use The Runas Command In Windows (2026)
- How To Use The Mklink Command In Windows (2026)
- How To Use The Setx Command In Windows (2026)
- How To Use The Findstr Command In Windows (2027)
- How To Use The Defrag Command In Windows (2027)
See all: Windows 11 Guides