#130025 - 2004-11-22 04:24 PM
New function
|
Anonymous
Anonymous
Unregistered
|
Hello, I am French (my english is not very good) and I start to write some Kix scripts
I would know to create some new function because I didn't find a function to map some drives according to the user's group(s). The better is so I can't some ini files or data base.
Thanks to you to answer me and I'm sorry for my bad english
Snake
|
|
Top
|
|
|
|
#130026 - 2004-11-22 04:27 PM
Re: New function
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
Well, would suggest you add the functionality of the INGROUP function and the USE statement, together it looks like this:
Code:
IF INGROUP("Domain Users")
USE M: "\\SERVER\SHARE"
ENDIF
Should give you what your looking for - try it out - if everything works, could incorporate this into a custom UDF, but get this bit working first.
-Shawn
|
|
Top
|
|
|
|
#130027 - 2004-11-22 04:29 PM
Re: New function
|
Anonymous
Anonymous
Unregistered
|
Ok but I can't create a custom function.
How to??
|
|
Top
|
|
|
|
#130028 - 2004-11-22 04:33 PM
Re: New function
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
First thing you will need is that latest version of Kixtart (4.22), then just create your function somewhere in your script, like this:
Code:
FUNCTION MapDrive($Group, $Drive, $Share)
IF INGROUP($Group)
IF EXIST($Drive)
USE $Drive /DELETE
ENDIF
USE $Drive $Share
IF @ERROR
? "Error mapping drive $Drive to $Share. "+@SERROR
ENDIF
ENDIF
ENDFUNCTION
Then, just call your custom function from elsewhere in your script (like from your "mainline") ... like this:
MapDrive("Domain Users", "M:", "\\SERVER\SHARE")
-Shawn
|
|
Top
|
|
|
|
#130029 - 2004-11-22 04:36 PM
Re: New function
|
Anonymous
Anonymous
Unregistered
|
Thanks to you for helping me.
I try your idea and I tell you teh result
still thank you
Snake059
|
|
Top
|
|
|
|
#130033 - 2004-12-06 10:14 AM
Re: New function
|
Anonymous
Anonymous
Unregistered
|
Quote:
what I am suggesting to you is to get this basic UDF working first
 Can you explain me what is "basic UDF" ?
|
|
Top
|
|
|
|
#130034 - 2004-12-06 11:32 AM
Re: New function
|
Jochen
KiX Supporter
   
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
|
|
Top
|
|
|
|
#130035 - 2004-12-06 12:10 PM
Re: New function
|
snake059
Lurker
Registered: 2004-12-06
Posts: 1
Loc: France, Nord, near Lille
|
danke gut für deine Antwort!!
entschuldigen Sie es für mein schlecht Deutsch aber zu sprechen auslanderin Sprachen
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 1257 anonymous users online.
|
|
|