I had the same issue - I have several computers that needs to communicate to a host Server. So I wrote a cmd file which uses the ping -t and tracert (if wanted) and captures the results to a txt file with date and time. I wanted to be able to run the capture from the host server for all my computers, and forget it. I downloaded forfiles.exe from the windows resource kit (google forfiles.exe download), and added a line in the script that deletes old logs to prevent the hard drive from filling up down the road. I've been running this script for several months and works like a champ.
To create the cmd file. Copy and paste the below script into notepad, and save it any name you want, with a .cmd ext. (example is Ping_Capture.cmd). Make a folder C:\Ping_Test and save the file there (unless you modify the script to run from a different folder)
A couple of things to look for. Make sure forfiles.exe is your path (I copied it to the windows\system32 folder), and make sure the cmd file ends with .cmd and not .txt. I had to go to a command window and rename it.
Doubleclick the script and it prompt for
- the IP address or Host name you want to ping (google.com)
- folder name (don't put in a path - just the name (Google)
- how many days to keep the logs
- include Traceert in the logs (Y/N)
Then a screen will show the details about the running script. Go to the log files and open them up in notepad.
----------------
@echo off
Rem This script needs to be ran from C:\Ping_Test, unless the script is modified.
Rem The script does a tracert, 500 pings and everyday deletes old log files.
Rem Creates a new log file every hour, in a date folder
Cls
Echo.
Echo.
Setlocal
Set _IP_Address=
Set _Fld_Name=
Set _Log_Limit=
Set _Tracert=
set _tr=
:IP
Set /P _IP_Address=Enter IP address or Host Name:
IF ERRORLEVEL 1 GOTO IP
:Fdr
Set /P _Fld_Name=Enter Folder Name:
IF ERRORLEVEL 1 GOTO Fdr
:log
Set /P _Log_Limit=Enter how many days to keep logs:
IF ERRORLEVEL 1 GOTO Log
:Trc
Set /P _Tracert=Inclued Tracert in Logs (Y/N) :
IF ERRORLEVEL 1 GOTO Trc
Set _logpath=c:\ping_test\Logs\%_Fld_Name%
echo %_Tracert%| find /i "Y" >NUL && set _tr=is
echo %_Tracert%| find /i "N" >NUL && set _tr=is not
if "%_tr%" == "" (set _tr=is not)
if not %_log_Limit% LEQ 100 set _log_Limit=1
for /F "tokens=2-4 delims=/- " %%c in ('date/T') do set _today=%%c-%%d-%%e
cls
Echo.
Echo.
Echo ******************************************************************
Echo.
Echo. Script started on %_today% at %Time%
Echo. Ping Capture for %_IP_Address%
Echo. Logs are located at c:\ping_test\Logs\%_Fld_Name%
Echo. Logs will be kept for %_Log_Limit% Day(s)
Echo. Trace Route %_tr% included in the logs
Echo.
Echo. CTL-C to stop the script
Echo.
Echo ******************************************************************
:Start
for /F %%a in ('Date /t') do (For /F "delims=/" %%b in ("%%a") do set _pday=%%b)
for /F "tokens=2-4 delims=/- " %%c in ('date/T') do set _today=%%c-%%d-%%e
for /F "tokens=1 delims=:" %%h in ('time /t') do set _Hour=%%h
for /F "tokens=2 delims=:" %%m in ('time /t') do set _min=%%m
echo %_min%| find /i "AM" >NUL && set _AmPm=AM
echo %_min%| find /i "PM" >NUL && set _AmPm=PM
if not exist "%_logpath%\%_today% %_pday%" md "%_logpath%\%_today% %_pday%"
Set _logfile="%_logpath%\%_today% %_pday%\%_Fld_Name%-%_hour%-%_AmPm%.txt"
Set _D=Date: %_today%
Set _T=Time: %Time%
echo %_D% >> %_logfile%
echo %_T% >> %_logfile%
If /i NOT %_Tracert% == Y goto

ing
tracert %_IP_Address% >> %_logfile%

ing
ping %_IP_Address% -n 500 >> %_logfile%
echo ----------------------------------------------------------- >> %_logfile%
for /F "tokens=2-4 delims=/- " %%c in ('date/T') do set _date=%%c-%%d-%%e
If NOT ("%_today%") == ("%_Date%") goto Cleanup
:Cleanup
ForFiles /P "%_logpath%" /d -%_Log_Limit% /C "CMD /C if @isdir==TRUE /Q /S @FILE &RD /Q /S @FILE" 2>Nul
goto start