icacls

Windows CMD · Files · reference only

What it does

Shows and modifies the NTFS permissions (access control lists) of files and folders.

Syntax

icacls ruta [/grant|/deny|/remove usuario:permiso] [opciones]

Options and parameters

  • /grant usuario:permiso

    Grants permissions: F full control, M modify, RX read and execute, R read, W write.

  • /deny usuario:permiso

    Explicitly denies permissions; it takes precedence over the allowed ones.

  • /remove usuario

    Removes all entries for that user.

  • /reset

    Resets the permissions to the default inherited ones.

  • /inheritance:e|d|r

    Enables, disables (copying) or removes permission inheritance.

  • /T

    Applies the operation to files and subfolders.

  • /C

    Continues even if errors occur.

Usage examples

  • icacls archivo.txt

    Shows the file's current permissions.

  • icacls archivo.txt /grant ana:(R)

    Gives ana read permission.

  • icacls carpeta /grant ana:(OI)(CI)M /T

    Gives ana modify permission on the folder and all its content.

  • icacls archivo.txt /remove ana

    Removes ana's permissions on the file.

Notes and common mistakes

  • (OI) and (CI) make the permissions inherit to files and subfolders.
  • To change permissions on a file that is not yours you may first need takeown.

Related commands