I'm a little tied up right now, but see if this will get you in the right direction. Check out WSHPipe() first.
The following example will show you, in stages, how to get the ms from a ping.
Code:
break on
;Put the output of ping into a variable(array)
$output=wshpipe("ping localhost",1)
;display the output
for each $line in $output
? $line
next
get $
;display the output with "Reply" in it
for each $line in $output
if instr($line,"reply")>0
? $line
endif
next
get $
;display the output with "Reply" in it and show the 5th token
;arrays in kixtart are zero based so the 5th token would actually be 4
for each $line in $output
if instr($line,"reply")>0
$data=split($line," ")
? $data[4]
endif
next
get $
;display the output with "Reply" in it and show the 5th token but only show the actual ms
for each $line in $output
if instr($line,"reply")>0
$data=split($line," ")
? split($data[4],"<")[1]
endif
next
get $
;Finally, the same output as above, but cleaned up code
for each $line in $output
if instr($line,"reply")>0
? split(split($line," ")[4],"<")[1]
endif
next
Function WshPipe($ShellCMD, OPTIONAL $NoEcho)
Dim $oExec, $Output
$oExec = CreateObject("WScript.Shell").Exec($ShellCMD)
If Not VarType($oExec)=9 $WshPipe="WScript.Shell Exec Unsupported" Exit 10 EndIf
$Output = $oExec.StdOut.ReadAll + $oExec.StdErr.ReadAll
If Not $NoEcho $Output Endif
$WshPipe=Split(Join(Split($Output,CHR(13)),''),CHR(10))
Exit($oExec.ExitCode)
EndFunction
Does this help?