Windows conditions, ping plus timestamp, and save to file for test network

Source: Internet
Author: User
Tags echo date

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.