Dear forum members.

I'm working in a very big enverment and now i want to make a kix script whit variable for reading a ini file for drive mappings. The drive mapping ar varaible whit groupmambership in AD.

I have made a script but it dosn't work. Can any body help me whit my problem.

Iám not a verry good scripter but i used a tool for making my script.

Here is a sample of my script.

Drivemapping.kix
 Code:
;===============================================================
Call "MyFunctions.kix"
$aryGroups = GroupArray()
$strIniFile = "c:\kixwork\mappings.ini"
For Each $ae in $aryGroups
  GroupMap($strIniFile,$ae)
Next
;===============================================================

Myfunction.kix

;===============================================================
Function GroupArray()
;===============================================================
Dim $i
Dim $strGrpLst
Dim $gName
$i = 0
$strGrpLst = ""
Do
 $gName = EnumGroup($i)
 $i = $i + 1
 If Len($gName) > 0
  If Len($strGrpLst) > 0
   $strGrpLst = $strGrpLst + ","
  EndIf
  $strGrpLst = $strGrpLst + $gName
 EndIf
Until Len($gName) = 0
$ary = Split($strGrpLst,",",-1)
;? "Before return array size is:" + Ubound($ary)
$GroupArray = $ary
EndFunction
;===============================================================

;===============================================================
Function GroupMap($inFile,$inSec)
;===============================================================
Dim $tmpDrv
$Sec = ReadProfileString($inFile,$inSec,"") 
$aMaps = Split($Sec,Chr(10),-1)
For Each $a in $aMaps
 $tmpDrv = ReadProfileString($inFile,$inSec,$a)
 $aParms = Split($tmpDrv,",")                     
  $act = UBound($aParms)
  Use $aParms[0] + ":" $aParms[1]
Next
$GroupMap = 1
EndFunction
;===============================================================


Mapping.ini
 Quote:

;===============================================================

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

;====================================
; IBB Kondor
;=Start==============================
[GS_IBB KONDOR_ACAD]
MapDrive1=F,\\dc-034\netapps$
MapDrive2=g,\\dc-034\usr$\%username%
MapDrive3=M,\\dc-034\acad$
MapDrive4=O,\\dc-034\acad direct$
;=End================================


I hope somebody can help me whit my problem.

Greetings

Bart Dirkx


Edited by Mart (2009-07-13 01:10 PM)
Edit Reason: Added code tags.