Sorry, didn't quite get it. See below:

 Code:
===================================================================
; $Function: setDrive
;  $Purpose: Map a drive letter (optionally remove previous)
; ===================================================================
Function setDrive($Letter,$Path,$Desc, $Unmap)

  If $Debug
    ? ">Mapping "+$Letter+" "+$Path+" ("+$Desc+")"
  Endif

  If $Unmap
    ; Because pre-existing persistent mapped drives are not removed with the below
    ; command, a shell command is used instead
    ;use $Letter /del
    $UnMap="net use "+$Letter+" /delete"
    If $Debug
      ? ">Unmap: "+$UnMap
    Endif
    ? " "
    shell $UnMap
  Endif

  ;use $Letter "$Path"
  Dim $Map
  $Map="net use "+$Letter+" "+chr(34)+$Path+chr(34)+" /persistent:yes"
  shell $Map
 
EndFunction




Edited by Glenn Barnas (2010-02-19 05:47 PM)
Edit Reason: added code tags