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:permisoGrants permissions: F full control, M modify, RX read and execute, R read, W write.
/deny usuario:permisoExplicitly denies permissions; it takes precedence over the allowed ones.
/remove usuarioRemoves all entries for that user.
/resetResets the permissions to the default inherited ones.
/inheritance:e|d|rEnables, disables (copying) or removes permission inheritance.
/TApplies the operation to files and subfolders.
/CContinues even if errors occur.
Usage examples
icacls archivo.txtShows the file's current permissions.
icacls archivo.txt /grant ana:(R)Gives ana read permission.
icacls carpeta /grant ana:(OI)(CI)M /TGives ana modify permission on the folder and all its content.
icacls archivo.txt /remove anaRemoves 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.