Geez - talk about complicated! ;\)

Untested, but this concept would be much simpler:
 Code:
If Exist($SpecialShareIniFile)
  ; get list of groups (sections) from ini file
  $aGroups = Split(ReadProfileString($SpecialShareIniFile), Chr(10))
  For Each $Group in $aGroups      ; enumerate groups from INI array
    If InGroup($Group)             ; member - process mappings
      $aMappings = Split(ReadProfileString($SpecialShareIniFile, $Group), Chr(10))
      For Each $Mapping in $aMappings
        $aDriveData = Split(ReadProfileString($SpecialShareIniFile, $Group, $Mapping), ',')
        Use $aDriveData[0] $aDriveData[1] ; or pass the raw data read directly to your mapping func
      Next
    EndIf
  Next
EndIf
This could be further simplified by changing your INI format from
DRIVE1=D:,path
to
D:=Path
allowing you to have direct access to the Drive Letter and Path without a subsequent Split().

You'll need to adapt this logic slightly to your specific needs, but eliminate the whole File Open/Read for an INI.. Also look at the EnumINI UDF, which can do most of this work for you, returning an array directly from the INI. Simplify the logic to make it easier to diagnose.

This is a Function, not a Subroutine. Replace the "Return" with an "Exit @ERROR", as Return is used to return from a subroutine.

Finally, you're calling an external function to map the drive - it might be ending there..

Glenn

PS - Gotta hit the road - I'll revisit this and clean it up in a bit...
_________________________
Actually I am a Rocket Scientist! \:D