Script NTFS Permissions Using SetACL
Created: 29 Aug 2008 | Updated: 13 Nov 2013 | 3 comments
If you ever need to script NTFS permission changes, SetACL is a powerful alternative to CACLS. Here is a command line that will use SetACL to grant full control to the Administrators and System accounts on folder and all subfolders:
SetACL.exe -on "C:\Program Files" -ot file -actn ace -ace "n:administrators;p:full" -ace "n:system;p:full" -actn clear -clr "dacl,sacl" -actn rstchldrn -rst "dacl,sacl"