-
Save file permissions in a
txt file
to be able to restore them if something went wrong:> icacls <path> /save <txtFilePath> [/t] [/c] [/l]
Permissions can be restored with
/restore
:> icacls <path> /restore <txtFilePath> [/c] [/l]
-
Get ownership of the files if needed:
> takeown /f <path> [/r]
-
Reset file permissions:
> icacls <path> /reset [/t] [/c] [/l]
-
Set new onwer for files if needed:
> icacls <path> /setowner <user|group> [/t] [/c] [/l]
Option | Description |
---|---|
/t, /r | Performs operation recursively on all files in the specified directory and subdirectories. |
/c | Skips errors, error message is still displayed |
/l | Performs operation on a symbolic link instead of its destination. |