ownership + permission script
Posted: 11 Apr 2012 06:31
hello,
i got a folder called "profiles" and inside this folder are 100+ profile folders of users, each user has it's own folder.
when i want to access a profile folder of a user, i first have to take ownership off the folder and then i have to give the administrators group full permission.
after i have done this, i have to change the ownership back to the original owner.
beacaus there are over 100 folders it is a lot of work to do this manually
so can someone tell me how i can write a .bat script to automate this process
i have never made a .bat script before.
in my opinion it has to be some kind of loop that checks folder by folder inside the c:\profiles folder. change the owner to administrator, give the administrors full controll and then change the owner back to the original user.
if someone could help me or give me some tips i would appreciate it very much
thanks
i got a folder called "profiles" and inside this folder are 100+ profile folders of users, each user has it's own folder.
when i want to access a profile folder of a user, i first have to take ownership off the folder and then i have to give the administrators group full permission.
after i have done this, i have to change the ownership back to the original owner.
beacaus there are over 100 folders it is a lot of work to do this manually
so can someone tell me how i can write a .bat script to automate this process
i have never made a .bat script before.
in my opinion it has to be some kind of loop that checks folder by folder inside the c:\profiles folder. change the owner to administrator, give the administrors full controll and then change the owner back to the original user.
if someone could help me or give me some tips i would appreciate it very much
thanks