Ping w/ Date Stamp


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
 
Ad

Advertisements

J

John Phillips

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).
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top