
【原創】XP下批處理得到最小網絡延遲報警退出可修改為得到外網IP@echo off & setlocal enabledelayedexpansiontitle 自動刷新V.10set /p mm=輸入希望延遲最小的毫秒@ping /n 1 127.0.0.1>nulset /p shu=輸入幾次加一秒@ping /n 1 127.0.0.1>nulecho 1 %mm%>ms.txt::echo 1 %mm%>>ms.txt@ping /n 1 127.0.0.1>nulset s=0@ping /n 1 127.0.0.1>nulset mod=0@ping /n 1 127.0.0.1>nulset x=%mm%:a@rasdial /DISCONNECT@ping /n 2 127.0.0.1>nul @rasdial 寬帶連接 666888 8888666@ping /n 6 127.0.0.1>nul ipconfig>ip.txt@set /a s+=1@echo %s%@ping /n 1 127.0.0.1>nulfor /f tokens=1-26 %%a in (ip.txt) do ( >100.txt echo %%m)@ping /n 1 127.0.0.1>nul for /f tokens=1-4 delims=. %%c in (100.txt) do ( >>101.txt echo %%eset a=%%e@ping /n 1 127.0.0.1>nul::ping 223.252.212.17:12788 -n 1 -l這里上下兩行不能分開for /f tokens=3 delims== %%i in ('ping 223.252.212.17 -n 1 -l 1^|find TTL') do (set TTL=%%i))@ping /n 1 127.0.0.1>nulset ms=%ttl:~0,-6%@ping /n 1 127.0.0.1>nulecho %a% %ms% >>ms.txt@ping /n 1 127.0.0.1>nulecho %a%@ping /n 1 127.0.0.1>nul ::沒有用到x::d=0時候輸出最大IF句用gtrset d=118::for /f tokens=1,2 %%y in (ms.txt) do ( ::邏輯比值LSS最小gtr最大 ::if %%z lss !d! (set d=%%z::set x=%%z::set ip=%%y)::)::執行幾次在+1set /a mod=s%%%shu%if !mod!==0 (set /a x+=1echo !s! 次數echo !x! x的值)@echo %s%echo 本次延遲%ms% 設置最小延遲%x%::leq小于等于::lss小于if /i %ms% leq %x% (goto b) else (goto a):bping /n 2 127.0.0.1>nulping /n 3 127.0.0.1>nulpause***********************一年的使用了 基本正常 修改可以 得到自己想要的外網IP【本人原創】 幫忙給精簡一下 謝謝

