bondbill2k2 Posted May 4, 2012 Posted May 4, 2012 I'm not much of a script writer at all, I currently have set /p userDir= Username: TAKEOWN /f "C:\Home Directories\%userDir%" /r /d y ICACLS "C:\Home Directories\%userDir%" /reset /T ICACLS "C:\Home Directories\%userDir%" /grant:r "SERVERNAME\%userDir%":(OI)(CI)M ICACLS "C:\Home Directories\%userDir%" /setowner "SERVERNAME\%userDir%" /T This works perfect for a single folder at a time, entering the username when prompted but I'd like to run this on a whole year of students, the idea is simple count the number of directories in the location specified. For each dir get the dir name and change the userdir parameter to this for each loop until all have been changed. I'm sure this wouldn't take long for someone who knows the syntax better then me I'll give it a go myself but might be beaten on here by other users, you beautifully brainy bunch!
plexer Posted May 4, 2012 Posted May 4, 2012 Or to make doubly sure it's only directories that are returned. dir /A:D /B Ben
plexer Posted May 4, 2012 Posted May 4, 2012 FOR /F "tokens=*" %%z IN ('dir /A:D /B "Path_goes_here"') DO (echo change perms %%z) For a start. Ben
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now