icacls batch file multiple directories with wildcards help needed

Posted by user153521 on Super User See other posts from Super User or by user153521
Published on 2012-08-21T00:37:27Z Indexed on 2013/06/27 22:24 UTC
Read the original article Hit count: 244

Filed under:
|

I have written the following batch file that does a great job combing through all folders beginning with the number 3 and applying folder permissions to any 2010 subfolder. Example of the batch filesis below:

for /D %%f in (D:\Data\3*) do icacls "%%f\2010" /inheritance:r /grant:r "Domain Admins":(OI)(CI)F

Question : How can I improve this script to allow for me to apply the permissions to a specific folder below ANY folder within the folders beginning with 3?

here is an example of my failed attempt:

for /D %%f in (D:\Data\3*) do icacls "%%f*\specificfolder" /inheritance:r /grant:r "Domain Admins":(OI)(CI)F

© Super User or respective owner

Related posts about wildcards

Related posts about icacls