Page 1 of 1 1
Topic Options
#138613 - 2005-04-25 06:04 PM search for folders by name
buckyo Offline
Lurker

Registered: 2005-03-25
Posts: 3
Good day,
I'm not sure if this would be possible or not, but figured I'd ask the gurus.
I have a huge folder structure with many instances of one folder name which I have to change permission on. The same folder name exists in many different locations.
Does anybody know if permissions can be set on the many instances of this folder name using a script?

Thanks

Top
#138614 - 2005-04-25 08:08 PM Re: search for folders by name
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Hello and Welcome to the board.

Short answer is yes it can be done from a remote admin script.

Longer answer is that you will need to do some searching and testing to get it going unless someone has the code already done and is willing to share.

To get started please take a look at the UDF listing (over 500 ready made functions)

KiXtart UDF Mirror

Also look in the FAQ section for methods to perform remote tasks and permissions, etc...

Good luck and let us know how it goes or if you need further assistance.

Top
#138615 - 2005-04-25 10:56 PM Re: search for folders by name
buckyo Offline
Lurker

Registered: 2005-03-25
Posts: 3
Thanks for the feedback I searched the UDF section and I'm using DIRPLUS.
I can find the needed folders, but I'm having problems using xcacls.vbs.
Here's my script so far
Code:

call DIRPLUS.kix
$xcacls = "c:\xcacls.vbs"
$cscript = "C:\windows\system32\cscript.exe"

$folders = Dirplus('c:\rootfolder','/s /ad /m homework')

For Each $folder In $folders
;? $folder
SHELL '$cscript $xcacls $folder /E /G "domain\user:LW"'
Next


This is the error I'm getting:
"Arguments Used: Filename is required and was not passed as an argument"
I'm a total newbie, so please go easy.
Thanks

Top
#138616 - 2005-04-25 11:06 PM Re: search for folders by name
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Since Windows\system32 or Winnt\system32 is in the search path, you can probably eliminate it to be just:
Code:

SHELL 'cscript.exe "C:\XACLS.VBS" $folder /E /G "domain\user:LW"'



HTH,

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#138617 - 2005-04-25 11:34 PM Re: search for folders by name
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
a few things.

1. Dirplus returns an array of COM objects. so to craft your shell command, you might not want to include the variable name inside of a string.

2. is there any reason that you are needing to use vbscript to call xcalcs?


Code:

shell '%comspec% /c xcalcs '+ $folder.path +' /E /G "domain\user:LW"'


Top
#138618 - 2005-04-26 02:36 AM Re: search for folders by name
buckyo Offline
Lurker

Registered: 2005-03-25
Posts: 3
Thanks for your replys.
I ended up using this tool to set permissions SetACL instead of the XCACLS.vbs tool which I downloaded from Microsoft.

Code:
call DIRPLUS.kix
$setacl = "c:\root\setacl.exe"
$folders = Dirplus('c:\root','/s /ad /m foldername')

For Each $folder In $folders
SHELL '%comspec% /C $setacl '+ $folder.path +' /dir /set %computername%\users /list_folder'
SHELL '%comspec% /C $setacl '+ $folder.path +' /dir /set %computername%\users /write'
Next



Again thanks for the quick replys

Top
#138619 - 2005-04-26 02:41 AM Re: search for folders by name
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
That will only work if run locally at the computer where the folders reside and the user needs enough rights to set rights.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1046 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.075 seconds in which 0.053 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org