Not very efficient, and the error handling isn't the best, but I don't see any real logic problem. For diagnosis, you might try simplifying this before adding capabilities back to the function.

The function takes one argument that is then broken into 3 values - the drive letter, the share path, and a description. The description is not used, so can be eliminated from this code and possibly from your INI file (trailing comma). I've simplified the beginning of the function to illustrate what I mean.
 Code:
Function ConnectShare($DriveDefinition)

  Dim $Rc

  ; split string on commas
  $DriveDefinition = Split($DriveDefinition, ',')
  ; assign array elements to working vars
  $DriveLetter = $DriveDefinition[0]
  $Share       = $DriveDefinition[1]

  ;Check Use List ;    $ListOfConnection=USE LIST  <- THIS IS NOT DONE SO REMOVE THIS COMMENT!!!
  Progress("Connecting " + $DriveLetter + " to " + $Share)
  DbgMessage("Info", "  - Connecting " + $DriveLetter + " on " + $Share)
  Use $DriveLetter $Share

  If @ERROR
    If @ERROR = 85
      DbgMessage("Info", "  - Disconnecting " + $DriveLetter + " on " + $Share)
      Use $DriveLetter /delete /persistent
      If @ERROR
        DBGMessage("DisMountError", $DriveLetter)
      EndIf

      If ($NT_mode = "no")
        $Rc = DelKey("HKEY_CURRENT_USER\Network\Persistent\" + $DriveLetter)
      EndIf

      Sleep $SleepTime
      DbgMessage("Info", "  - ReConnecting " + $DriveLetter + " on " + $Share)
      Use $DriveLetter $Share
      If @ERROR <> 0
        DbgMessage("MountError", "  - Mount Error " + $DriveLetter + " on " + $Share)
        DBGMessage("MountError : ", @ERROR = @SERROR)
        DbgMessage("Info", "  - Mounting on Next Free Letter : " + $Share)
        Use * $Share
      EndIf
    Else
      DBGMessage("MountError : ", $DriveLetter + " on " + $Share)
      DBGMessage("MountError : ", @ERROR = @SERROR)
      DbgMessage("Info", "  - Mounting on Next Free Letter : " + $Share)
      Use * $Share
      If $DebugFlag = 1
        Sleep 3
      Else
        Sleep $SleepTime
      EndIf
    EndIf
  EndIf
EndFunction
I have concerns about the use of undeclared variables in functions, which likely means that they are global in your main script. There is no isolation between functions and the main script, resulting in problems that are hard to diagnose. Variables should be declared in the main script, and values passed to the functions. It seems like the person that wrote this simply put a function definition around an old subroutine rather than doing a proper rewrite. Also - what's with all the Sleep commands? Usually, you'd want the login script to run as fast as possible. My ULS can run in as little as 0.875 seconds.

With the global variable issue and without seeing the entire script, there isn't much more we can do to diagnose. Honestly, you should be considering a rewrite of this to improve the reliability.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D