Skip to content

Instantly share code, notes, and snippets.

@webgtx
Created June 17, 2023 04:15
Show Gist options
  • Save webgtx/9ab360d1adca4c80c372d18bfb22617a to your computer and use it in GitHub Desktop.
Save webgtx/9ab360d1adca4c80c372d18bfb22617a to your computer and use it in GitHub Desktop.
Sample ICACLS commands to set owner, grant full control, read-only, and read plus execute access
::Set Owner of a specific file
ICACLS "D:\test\test.txt" /setowner "administrator"
::Grant Full Control
ICACLS "D:\test\test.txt" /grant:r "administrator:(F)" /C
::Grant Read and Execute Access of a specific file
ICACLS "D:\test\test.txt" /grant:r "users:(RX)" /C
::Grant Read-only Access of a specific file
ICACLS "D:\test\test.txt" /grant:r "users:(R)" /C
@webgtx
Copy link
Author

webgtx commented Jun 17, 2023

You can specify full path only

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment