How to implement "USE MOST /DELETE"
 Code:
; Define drives not to remove - home drive and any "permitted, persistent mappings"
$Exceptions = '%HOMEDRIVE% O: P: Q:'

; remove non-excepted drive mappings
For $D = 65 to 90
  $DL = Chr($D) + ':'
  If Not InStr($Exceptions, $DL)
    'use ' $DL ' /delete' ?
    ; use $DL /delete
  Else
    'not deleting drive map!' ?
  EndIf
Next
This works, but is pretty basic. The messages should be used only during debugging as it's pretty chatty otherwise.

Note that no error checking/reporting is done in this example.

Also, our commercial script will determine if the logon process is active or not, and either ignore trying to map the home share if it is, or will map it if it isn't. This is useful in situations where a user might connect via VPN after loggong on to their PC and maps their drives by manually invoking the login script.

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