Computing.Net > Forums > Programming > DOS batch file need to rec pings

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

DOS batch file need to rec pings

Reply to Message Icon

Name: grimeyD
Date: September 21, 2006 at 02:51:18 Pacific
OS: nt
CPU/Ram: n/a
Product: n/a
Comment:

Hi i need to know how to create a batch file that, besides recording the pinging of an IP device, adds the TIME of each PING at the end of each line e.g. Out put to look like this:

Reply from 172.16.1.1: bytes=32 time=16ms TTL=255 TIME
Reply from 172.16.1.1: bytes=32 time=16ms TTL=255 TIME
Request Timed Out TIME

This is the batch file i am using currently:

ping 172.16.1.1 -t > batch.txt




Sponsored Link
Ads by Google

Response Number 1
Name: Shr0Om
Date: September 21, 2006 at 03:05:53 Pacific
Reply:

You cant do that if you use ping with the -t option. You could try this:

@echo off
:start
ping 172.16.1.1 -n 1 >>log.txt
echo TIME:%time% >>log.txt
echo ---------------- >>log.txt
goto start


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: DOS batch file need to rec pings

Batch file: Adding to file names www.computing.net/answers/programming/batch-file-adding-to-file-names/9098.html

DOS Batch File Commands www.computing.net/answers/programming/dos-batch-file-commands/14637.html

Spilt a numeric value in dos batch file www.computing.net/answers/programming/spilt-a-numeric-value-in-dos-batch-file/19115.html