OK - here's a replacement function that I was able to test. I created dummy functions for Progress, DbgMessage, and ConnectShare (as shown below) that perform simple display of the data. I updated your INI file to use two real groups to verify that all will work. I also used the EnumINI UDF (download latest version from the Resources pages on my web site) to simplify working with the INI file. EnumINI performs the following tasks:
  • Called with just the INI file name, it returns an array of section names;
  • Called with the file name AND a section name, it returns an array of value names in that section.


Here's the code to test the replacement function:
 Code:
Call 'K:\KixLib\EnumIni.kxf'

Global $SpecialSharesIniFile
$SpecialSharesIniFile = '.\special.ini'

ConnectSpecialShares(); Call the function being tested & show the error result message
@SERROR ?


; Updated ConnectSpecialShares function:
Function ConnectSpecialShares()

  Progress("Connecting Special Shares")
  DbgMessage("Info", "Connecting Special Shares")
  DbgMessage("Info", "  SpecialSharesinifile = " + $SpecialSharesIniFile)

  ; Exit now if the file doesn't exist
  If Not Exist($SpecialSharesIniFile) Exit 2 EndIf

  ; Get a list of sections from the ini file using the EnumINI UDF
  $aSections = EnumINI($SpecialSharesIniFile)

  ; enumerate the sections (which are AD group names)
  For Each $Group in $aSections

    ; check group membership
    If InGroup($Group)
      ; get the list of drive map definitions
      $aMappings = EnumINI($SpecialSharesIniFile, $Group)

      ; Enumerate the mappings and make the connection using the ConnectShare UDF
      For Each $Share in $aMappings
        $DriveDefinition = ReadProfileString($SpecialSharesIniFile, $Group, $Share)
        ConnectShare($DriveDefinition)
      Next
    EndIf
  Next

  Exit 0

EndFunction



; Dummy support functions follow

Function ConnectShare($Def)
  $aDat = Split($Def, ',')
  'Mapping ' $aDat[0] ' to ' $aDat[1] ?
  Exit 0
EndFunction

Function Progress($Msg)
  'Progress: ' $Msg ?
EndFunction

Function DbgMessage($Lvl, $Msg)
  'Debug: ' $Lvl ' - ' $Msg ?
EndFunction
Here's the result of the test:
 Code:
Progress: Connecting Special Shares
Debug: Info - Connecting Special Shares
Debug: Info -   SpecialSharesinifile = .\special.ini
Mapping P: to  \\SERVERA\C$
Mapping R: to  \\SERVERB\C$
Mapping G: to  \\SERVERC\DATA.MS1$
Mapping B: to  \\SERVERD\DATA.WTA$
The operation completed successfully.
Do not use the CALL statement - copy/paste the EnumINI UDF directly into your script (anywhere, but usually at the end).

Glenn



_________________________
Actually I am a Rocket Scientist! \:D