Friday, November 23, 2012 8:02 AM
Hi, I need to change permissions on a bunch of subfolders, all with the same name (eg. A) but cannot seem to get the syntax correct. I have a parent folder called e:\test, within that I have sub folders called 1, 2 and 3. In each of those is an A and B folder. Now what I woulike like to do is from the parent test folder, run ICACLS on any subfolder under 1, 2 and 3 called 'A' (on my production server the folder is called Management) and change permissions. This is what I've tried:
for /f %i in ('dir e:\test\*a* /s /ad') do icacls %i /grant "management":(OI)(CI)F /inheritance:r
I have tested the ICACLS part on it's own and it works fine. The issue is the FOR and dir... part.
Any help please?
Friday, November 23, 2012 12:13 PM
Kindly post in scripting guys forum.
If you found this post helpful, please give it a "Helpful" vote.
If it answered your question, remember to mark it as an "Answer".
This posting is provided "AS IS" with no warranties and confers no rights! Always test ANY suggestion in a test environment before implementing!
- Marked As Answer by Cheers ZHANGMicrosoft Contingent Staff, Moderator Tuesday, November 27, 2012 8:04 AM