windows bat file ping add time
ขั้นแรก สร้าง bat file ขึ้นมา เช่น test_ping.bat แล้ว แปะ code นี้ไป
@echo off
ping -t -l 1000 -n 3 8.8.8.8|cmd /q /v /c “(pause&pause)>nul & for /l %%a in () do (set /p “data=” && echo(!time! !data!)&ping -n 2 localhost>nul”
วิธีการ run กับผมจะแนวๆนี้
D:\>test_ping.bat
10:35:40.79 Pinging 8.8.8.8 with 1000 bytes of data:
10:35:41.83 Reply from 8.8.8.8: bytes=1000 time=24ms TTL=120
10:35:42.88 Reply from 8.8.8.8: bytes=1000 time=24ms TTL=120
จริงๆอยากเพิ่มวันที่และ ให้เขียนลงไฟล์ด้วย แต่ยังไม่มีเวลาทำต่อ ใครรู้ก็บอกๆกันเด้อ