Somewhere in your script I should see:
 Code:
Dim $HomeShr, $AppShr, $AfdShr

$HomeShr = $DFS + "\Home" ;Leiden home share
$AppShr = $DFS + "\Applicatie" ;Leiden Applicatie share
$AfdShr = $DFS + "\Afdeling" ;Leiden Afdeling share

MapDrv("F:", $HomeShr)
MapDrv("I:", $AppShr)
MapDrv("J:", $AfdShr)

Function MapDrv($Drv, $Shr)
	USE $Drv $Shr
	ShowStatus("Mapping $Shr: ", 2)
	IF @ERROR <> 0
		USE $Drv /DELETE /PERSISTENT
		USE $Drv $DFS + $DataShr
		ShowStatus("Mapping $Shr: ", 1)
	ENDIF
EndFunction 


I have included my UDF for you to use as a comparison. Note that it requried additioanl UDFs WriteLog and WriteLog2 which are available in the UDF library.
 Code:
Function MapDrive($Drive, $Server, $Share)
  Dim $Drive, $Server, $Share, $shell
  Color c+/n

  If $Drive<>"" and $Server<>"" and $Share<>""
    $LogText="Connecting $Drive to \\$Server\$Share"
    ? $LogText
    USE $Drive /Delete /Persistent
    USE $Drive "\\$Server\$Share"
    If @error=0
      color g+/n
      $x=" - Success"
      "$x"
      If val($DOS) >= 5
        $shell=createobject("shell.application")
        $shell.namespace($Drive+"\").self.name=$Share + " on '" + $Server + "'"
        $shell = 0
      Endif
    Else
      color r+/n
      $x=" - Failed: Error @error"
      "$x"
      $ErrorState=1
    Endif
    WriteLog ($LogText + $x)
    WriteLog2("%temp%\MapDrive.log",$LogText + $x,1)
    Color w+/n
  Else
    WriteLog ("Function 'MapDrive' called with invalid parameters: '$Drive', '$Server', '$Share'")
  Endif
Endfunction
 
_________________________
Home page: http://www.kixhelp.com/hb/