Ping w/ Date Stamp

  • Thread starter Thread starter Julian
  • Start date Start date
J

Julian

Can someone help me with this?

I need to know how to ping an IP and append/prepend a date/time stamp to the
result and then log to a file. I need to do this ping forever until I stop
the process.

I have been searching the net and found several batch files for this, but
none work?

Thanks
 
Try this in a batch file:

:START
date/t && time/t && ping -n 10.51.6.2
goto START

and then execute it like this:
c:\> mybatchfile.bat > logfile.txt

Of course, this will fill up your logfile pretty quickly, so you'll have to
insert a pause somehow just before the "goto START" line. My suggestion
would be to write a small program which calls the Win32 Sleep() function (or
find someone who's already done it).
 
Back
Top