找回密碼
 註冊
搜索
查看: 8767|回復: 0

Timestamp Ping 在 Ping 前方加上時間

[複製鏈接]
發表於 2013-9-3 13:24:44 | 顯示全部樓層 |閱讀模式
  1. @echo off
  2. for /f "tokens=*" %%A in ('ping %1 -n 1') do (echo %%A && GOTO Ping)
  3. :Ping
  4. for /f "tokens=* skip=2" %%A in ('ping %1 -n 1') do (echo %date%%time% %%A && GOTO Ping)
複製代碼
使用範例:
timeping 192.168.1.254

如果要存到文字檔:
timeping 192.168.1.254 > ping.log
要停的時候按Ctrl+C,再按下Y,再按下Enter

Reference: http://www.pcreview.co.uk/forums/timestamp-ping-t1467756.html

timeping.bat

181 Bytes, 下載次數: 1616

您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

Archiver|手機版|彩色筆小沛的知識庫

GMT+8, 2024-4-24 21:10 , Processed in 0.016206 second(s), 10 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回復 返回頂部 返回列表