This is taken a little bit out of its context, but you see the code wich i use to check if there is a networkdrive.

IF $E<>""
? " E: $E"
$ReturnCode=ExistKey ("HKEY_CURRENT_USER\NETWORK\E")
If $ReturnCode=0
SHELL "CMD.EXE /C NET USE E: /D >nul"
ENDIF
USE E: /DEL
USE E: $E
ENDIF

Svein A