Icacls Permissions help PLEASE

Hi guys, 

I have the below script that runs though folder and applies permissions to all folders, named "staff" and its content.

It does work, BUT until its gets to a folder with spaces in the name then it fails. I have thousands of folder names with spaces. Can someone please help me tweak this code to make it work?

This is my code, thank you very much.

for /F %i in ('dir F:\CurrentClients\*staff* /s /b /ad') do icacls %i /grant "SG-staff":(OI)(CI)(RX,W,AD,WA,WEA,REA) /inheritance:r

July 31st, 2015 3:52am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics