Tuesday, September 18, 2018

Ping command utility with datetime stamp

Dear All,

Sometimes using the external client FTP/SFTP or shared folder path it has been observed that files getting missed or file un-properly copied with data loss. to avoid such circumstances we have a nice feature in windows called PING, we can utilize the capability of ping to monitor the network availability. so i have added some more concrete logging with the help of datetime command. here is the entire script which one can save as .BAT file and continue to run in background.


@echo off
    ping -t ftp.yourftp.com|cmd /q /v /c "(pause&pause)>nul & for /l %%a in () do (set /p "data=" && echo(!date! !time! !data!)&ping -n 2 ftp.yourftp.com>nul"


Happy Coding!!!!!!

No comments:

Post a Comment