㈠ ping命令結果中如何顯示時間
可以通過批處理實現,在後面加上時間。
@echo off
d:
for /l %%i in (1,1,%999999999%) do (
ping%1192.168.1.1 -n 1% && echo %% >>ping.txt
date /t >>ping.txt
time /t >>ping.txt
)
pause
注意事項
ping命令腳本:
:top
setBACKUPDATE=%date:~0,4%%date:~5,2%%date:~8,2%獲取當前系統的年月日
echo%time%>>flogin.aspx_%BACKUPDATE%log.txt
ping-n1www..com|findstr"TTL">>flogin.aspx_%BACKUPDATE%log.txt
gototop
:top
echo%time%>>gateway_%BACKUPDATE%log.txt當前系統時間追加到txt文檔中
ping-n1127.0.0.1|findstr"TTL">>gateway_%BACKUPDATE%log.txt
gototop