I've come in this morning and realised that some changes i made over the holiday haven't worked quite as i hoped. I now need a way to take ownership of files and folders, then set them to inherit their permissions from above.
I've figured out how to take ownership with the takeown command, but can't find a way to set the inherit permissions setting on them without doing it manually! Is there a command i can run that will set this? I really don't want to have to do it manually!?!
I will need to script this so that it does it for every user, but only certain folders are affected.... (Application Data, Desktop)
Anyone know how i can do this?
I figured it out
I usedto take ownership of the folders/filesCode:takeown /F * /R
thento set the inherit setting.Code:xcacls.vbs "Application Data" /I Enable /T
test.txt contained all the staff usernames, and it was the Application Data folder that needed modifying.Code:@echo off for /F %%g IN (test.txt) DO ( cd %%g\ @echo Doing %%g takeown /F * /R @echo Owned %%g xcacls.vbs "Application Data" /I Enable /T /F @echo Done %%g cd ..)
It also echoes the progress at various stages.
It's probably not perfect but it worked
Last edited by bmdixon; 20th April 2009 at 01:26 PM. Reason: missed option from xcacls
There are currently 1 users browsing this thread. (0 members and 1 guests)