Sure would be nice if you could just copy/paste the code above....

Ok, tested the above code and it did work as expectd for me. [Wink]


Break On
$HOST = "@WKSTA"
$TEMP = "%temp%\ping.txt"
SHELL '%COMSPEC% /c ping $HOST -n 1 | find /i "TTL" >"$TEMP"'
$IP = ""
If Open(1,$TEMP) = 0
$Line = ReadLine(1)
If $Line
$IP = SubStr($Line,12,InStr($Line,":")-12)
EndIf
$= Close(1)
EndIf
?"IP=" $IP
Exit 1