The Script runs on a Win2k-Workstation.
I've solved the problem, though it might be a bit rough as i'm not that able to hand back a multidimensional array (maybe you can help there)
Code:
;FUNCTION NetViewSH()
;
;ACTION Gets Computernames, Descriptions and IPs from a network without WMI-Usage
;
;VERSION 0.9
;
;KIXTART VER 4.53
;
;AUTHOR Andreas "private_meta"
;
;SYNTAX $ = NetViewSH("Domain")
;
;PARAMETERS Domain
; Domain Name for a network, optional
;
;RETURN Nothing
;
;REMARKS none
;
;DEPENDENCIES working network ;)
;
;EXAMPLE
; NetViewSH()
; FOR $i = 1 TO UBOUND($net_names)
; $net_names[$i] + " " + $net_descr[$i] + " " + $net_ips[$i] ?
; NEXT
;
;KIXTART BBS none yet ;)
;
Function NetViewSH(optional $domain)
GLOBAL $net_names[255]
GLOBAL $net_descr[255]
GLOBAL $net_ips[255]
DIM $REDIM $REDIM = 255
DIM $i $i = 0
DIM $j $j = 0
DIM $tempfile $tempfile = "%temp%\netview2.pmt"
DIM $tempfile1 $tempfile1 = "%temp%\netview3.pmt"
IF $domain
$domain = "/domain:$domain"
ENDIF
IF Exist($tempfile)
DEL $tempfile
ENDIF
SHELL '%comspec% /c net view $domain >"$tempfile"'
IF @error = 0
IF Open(10,$tempfile) = 0
DO
$line = ReadLine(10) ; skip header
UNTIL SUBSTR($line,1,2) = "\\"
WHILE @error = 0
$net_names[$i] = RTrim(SubStr($line,3,InStr($line," ")-1))
$net_descr[$i] = LTrim(RTrim(SubStr($line,19,60)))
SHELL "%comspec% /c ping -n 1 " + $net_names[$i] + " > " + "$tempfile1"
IF Open(9,$tempfile1) = 0
DO
$line1 = ReadLine(9)
UNTIL SUBSTR($line1,1,4) = "Ping" OR @ERROR=-1
IF @ERROR=-1
$net_ips[$i] = "0.0.0.0"
ELSE
$net_ips[$i] = SPLIT(SPLIT($line1,"[")[1],"]")[0]
ENDIF
ENDIF
$x=CLOSE(9)
$i=$i+1
IF $i = $REDIM
$REDIM=$REDIM*2
REDIM $net_names[$REDIM]
ENDIF
$line = ReadLine(10)
Loop
$x=Close(10)
DEL $tempfile
DEL $tempfile1
IF $i
REDIM preserve $net_names[$i-4]
;$netview = $net_names
EXIT @error
ENDIF
FOR EACH $item IN $net_names $item ? NEXT
ENDIF
ENDIF
;$netview = $net_names
EXIT @error
ENDFUNCTION