Hello,Drives mapped with: "use d: ..." are not persistent unless you add the /persistent. You may verify this by running the following subroutine to enumerate persistent connections after you map your network drives.
code:
;****************************************************************************************
:ENUMPERSIST
; Description:
; Enumerate all the user's persistent connections. Want to keep it in a log
; in case the user has a problem.
;
; Input:
; $OS, $HKCU, $user
;
; Output:
; None
;****************************************************************************************
; Modification History
; Date Initials Description
; 11 Aug 99 bvv Wrote first cut.
;****************************************************************************************
;
Dim $index, $persist, $loop_index, $name, $keyname, $p_name, $returncode
$index=0
If $OS="Win9x"
$persist="$HKCU\Network\Persistent"
Else
$persist="$HKCU\Network"
Endif
? "Enumerate the persistent connections: "+$persist
$loop_index=0
While $loop_index=0
$name=EnumKey("$persist",$index)
$loop_index=@ERROR
If $loop_index=0
$keyname=$persist+"\"+$name
$p_name=ReadValue("$keyname","RemotePath")
? "The enumerated value is: "+$name+" and its UNC is: "+$p_name+"."
; If you want to delete the keys, uncomment the next few lines.
; $returncode=DelKey($keyname)
; If $returncode=0
; ? "The persistent connection to "+$p_name+" was deleted."
; ? "The index value is: "+$loop_index+"."
; Else
; ? "There was a problem deleting the persistent connection to: "+$p_name
; Endif
$index=$index+1
Else
If $loop_index=259
; This error should come up when all entries have been enumerated.
? "All persistent connections have been listed."
Else
; An unknown error has occurred.
? "An error has occurred while enumerating persistent connections. The"
? "error number is: "+$loop_index+"."
Endif
Endif
Loop
Return
$OS is set to either "Win9x" or "Windows NT" elsewhere.
$HKCU is set to "HKEY_CURRENT_USER"
and $user is set to @USERID
------------------
Regards,
Brad
Consultant
Net InfraStructure, Inc