Hi Bart,

Welcome to the board.

First:
Please use the code tags when posting code (the # button when creating a post). This time I added them for you.

Second:
Below is a small example of a logon script that enumerates all groups belongs to and then mapps drive based on data in the ini file.

Third:
Be careful with hidden shares because kix might interpret the dollar sign as a variable. You can fix this with Setoption("NoVarsInStrings", "On") at the top of the script our you can double the dollar signs.

Script:
 Code:
;Enumerate all group for the current user.
$goups = arrayenumgroup()
;Start the magic for each group.
 For Each $group in $groups
	;Read the number of drives to be mapped for each group.
	$drives = ReadProfileString("c:\kixwork\mappings.ini", $goup, "NumberOfDrives")
	;Map each drive.
	For $i = 1 to $drives
		;Read drive data from ini file.
		$drive = ReadProfileString("c:\kixwork\mappings.ini", $goup, "MapDrive" + $i)
		$drive = Split($drive, ",")
		Use $drive[0] + ': "' + $drive[1] + '"'
	Next
Next

;DO NOT MODIFY ANYTHING BELOW THIS LINE.
;IT IS A UDF AND IT COMES READY FOR USE.

;NAME          ARRAYENUMGROUP
;
;AUTHOR        Jens Meyer (sealeopard@usa.net)
;
;ACTION        Creates an array of groups of which the current user is a member
;   
;SYNTAX        ARRAYENUMGROUP()
;  
;PARAMETERS    none
;
;RETURNS       Array containing the group names
; 
;REMARKS       none
;
;DEPENDENCIES  none
;  
;EXAMPLE       $retcode=arrayenumgroup()
;
Function arrayenumgroup()
  Dim $retcode, $valuecounter, $currentvalue, $valuearray
  
  $valuecounter=0
  Do
    $currentvalue=EnumGroup($valuecounter)
    If $currentvalue<>259 And @ERROR=0
      ReDim preserve $valuearray[$valuecounter]
      $valuearray[$valuecounter]=$currentvalue
      $valuecounter=$valuecounter+1
    EndIf
  Until $currentvalue=259 Or @ERROR
  
  $arrayenumgroup=$valuearray
EndFunction


Ini file:
 Quote:

[GS_bebouw_acad]
NumberOfDrives=4
MapDrive1=F,\\dc-073\netapps$
MapDrive2=g,\\dc-073\usr$\%username%
MapDrive3=N,\\dc-073\acad$
MapDrive4=O,\\dc-073\acad direct$


Edited by Mart (2009-07-13 01:24 PM)
Edit Reason: Typo.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.