Lookup WshPipe() UDF in the UDF Library. It is required for this code sample.
code:
Break on
$rc=WshPipe("%comspec% /c net use", 1)
for each $line in $rc
if instr($line, "Servername\share"
? $line + " found"
endif
next
? "Exit Code: " @error " " $WshErrorMsg

_________________________
Home page: http://www.kixhelp.com/hb/