Create a new file under C drive Ping.vbs
Enter the following code in the Ping.vbs:
Dim args, flag, Unsuccout args=""Otherout=""Flag=0IfWScript.Arguments.count = 0Then WScript.Echo"Usage:cscript Tping.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.QuitEnd if forI=0 to Wscript.arguments.count-1args=args &" "&wscript.arguments (i) Next Set Shell= WScript.CreateObject ("Wscript.Shell") Set re=New RegExp Re. Pattern="^reply|^request|^ from |^ request"Set myping=shell. Exec ("Ping"&args) whileNot myping. Stdout.atendofstream StrLine=myping. Stdout.readline () ' WScript.Echo"Original Data"& Chr (9) &StrLine R=Re. Test (StrLine)IfR then WScript.Echo date&" "& Time & Chr (9) &strLine Flag=1ElseUnsuccout=unsuccout &StrLineEnd ifWendifFlag = 0Then WScript.Echo UnsuccoutEnd if
At the command line, enter
The command line enters the C drive and enters the following command,
cscript ping.vbs www.baidu.com-t-L 1000-w 5000>sseping.txt
Windows conditions, ping plus timestamp, and save to file for test network