blimey! All that vb seems a bit longwinded to me! Mine's a windows batch file:
Code:
for /f "Tokens=*" %%i in ('dir /b /ad "E:\year7\"') do subinacl /subdir "E:\year7\%%i\*.*" /setowner=mydomain\%%i (one line per parent folder) to do the ownership. It could be tweaked easily to take an argument on the commandline, but I feel safer using hard-coded values. You need to use a recent version of subinacl (mine is 5.2.3790.1180)
To give the folder's owner NTFS full control, I do:
Code:
for /f "Tokens=*" %%i in ('dir /b /ad "\\myserver\year7\"') do @cacls "\\myserver\year7\%%i" /E /T /G "mydomain\%%i":f Having them separate is handy because it can take a long time to run these through.