================================windows=================================
''
"Use method
'; cscript ping.vbs 172.26.163.10-t-L 1000
''
Dim args, flag, unsuccout
Args= ""
Otherout= ""
Flag=0
If WScript.Arguments.count = 0 Then
WScript.Echo "Usage:cscript Ping.vbs [-t] [-a] [-N Count] [-l size] [-f] [-I TTL] [-v TOS]"
WScript.Echo "[-S count] [[-j host-list] | [k Host-list]] "
WScript.Echo "[-R Count] [-w timeout] destination-list"
Wscript.Quit
End If
For I=0 to Wscript.arguments.count-1
Args=args & "" & WScript.Arguments (i)
Next
Set shell = WScript.CreateObject ("Wscript.Shell")
Set re=new REGEXP
Re. Pattern= "^reply|^request"
Set Myping=shell. Exec ("tracert" & args)
While not myping. Stdout.atendofstream
Strline=myping. Stdout.readline ()
R=re. Test (StrLine)
If R Then
WScript.Echo Date & "" & Time & Chr (9) & StrLine
Flag=1
Else
Unsuccout=unsuccout & StrLine
End If
Wend
If flag = 0 Then
WScript.Echo Unsuccout
End If
================================linux=================================
# while:;d o ping-c 1 172.17.39.251|awk '/ttl=/' |sed ' s/^/' date +%y-%m-%d\|%t '/'; sleep 1;done