Home All Groups Group Topic Archive Search About

I need a script (pref VB) to change permissions on a folder in multiple folders.



Author
20 Oct 2007 11:35 PM
Woody
I need a script (pref VB) to change permissions on a folder in multiple
folders.


Example, imagine users home directory, so a folder contains all the users.
Each user has a folder insiide their home driectory called 'examples'. I
need a script to search for that folder inside each users home directory and
change the permissios to 'read, list folder contents'

Can this be done?


This is not being done on users home directories but this was the best
example i could give.


Or imagine their are 10 folders named 1 to 10. inside each folder are 5
folders named A,B,C,D and E. I want a script to search for the folder named
'D' and change the permission on that folder only.

Author
25 Oct 2007 8:40 AM
neothwin
Hi,

pls try the batch script below.
--------------------------------------
@echo off
setlocal

rem Set the path of folder where Users' home folder exist
set SourcePath=c:\test

rem set the target folder name to search for and change permission
set TargetFolder=Example

rem set the user/group name to edit/change the permission on the terget folder
set account=everyone

rem Use xcacls and set %account% to "E"  REad (Special access permission.
for /f "usebackq delims=" %%a in (`"dir %SourcePath% /ad /b"`) do xcacls
"%%a"\%TargetFolder% /t /e /p %account%:E

endlocal
@echo on
---------------------------------------

You may need to install WinXp support tool to use "xcacls". For normal
permission, "cacls" command can be used. pls do some testing first.


Show quote
"Woody" wrote:

> I need a script (pref VB) to change permissions on a folder in multiple
> folders.
>
>
> Example, imagine users home directory, so a folder contains all the users.
> Each user has a folder insiide their home driectory called 'examples'. I
> need a script to search for that folder inside each users home directory and
> change the permissios to 'read, list folder contents'
>
> Can this be done?
>
>
> This is not being done on users home directories but this was the best
> example i could give.
>
>
> Or imagine their are 10 folders named 1 to 10. inside each folder are 5
> folders named A,B,C,D and E. I want a script to search for the folder named
> 'D' and change the permission on that folder only.
>
>
>

AddThis Social Bookmark Button