# icacls

### Display the DACLs of specified input

```powershell
C:\> icacls [dir]
C:\> icacls [executable_file].exe

# eg. for directory
C:\> icacls C:\filedir
c:\filedir NT AUTHORITY\SYSTEM:(I)(OI)(CI)(F)
              BUILTIN\Administrators:(I)(OI)(CI)(F)
              ...

# eg. for executable file
C:\> icacls c:\filedir\exec_file.exe
c:\filedir\exec_file.exe 
             NT AUTHORITY\SYSTEM:(I)(F)
             BUILTIN\Administrators:(I)(F)
             ...

```

Refer to the `icacls` documentation link below for information about each of the permission values:

{% embed url="<https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/icacls>" %}

### Modify the DACLs

**Eg**. Grant read-only access `(R)` to the `Everyone` group on the `bin.exe`file.

```powershell
C:\> icacls bin.exe /grant Everyone:R
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://jarrettgxz-sec.gitbook.io/windows/access-control-and-permissions/icacls.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
