Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Output Ping command to File with system TIME

Status
Not open for further replies.

Ranvier

Programmer
Jun 17, 2004
73
GB
Hi There,

I want to ping results to a file but also want to capture the system time as my connection keeps dropping out and I am trying to find out exactly when it is happening.

The command I am using at the moment is:

ping servername -t >> log.txt

is there an additional command I can add to this to output the time each ping was made (and therefore know what time its failing)?

Thanks in advance
 
Create a batch file (.bat) containing the following commands

Crude, but simple and should work.

@echo off
:start
date /t >>log.txt
time /t >>log.txt
ping servername >> log.txt
goto start

Modify to suit you. As it stands it will log the date and time, then ping "servername" 4 times and then repeat - ad nauseam.

[navy]When I married "Miss Right" I didn't realise her first name was 'always'. LOL[/navy]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top