联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!
CODE: [Copy to clipboard]@echo off set MinL=99 set MinT=9999ms set Best="" for /f "usebackq" %%a in ("QQlist.txt") do ( call :time %%a ) echo 最佳服务器:%Best% echo 最佳服务器的响应时间:%MinT% goto :eof :time for /f "skip=11 tokens=4 delims==" %%a in ('ping %1') do ( if "%%a" equ " 0ms" ( set /a Best=%1 ) else ( call :best %%a %1 ) goto :eof ) :best for /f "skip=1 delims=:" %%a in ('^(echo %1^&echo.^)^|findstr /o ".*"') do set nowlen=%%a if "%nowlen%" lss "%MinL%" ( set /a MinL=%nowlen% set MinT=%1 set Best=%2 ) else if "%nowlen%" equ "%MinL%" ( if "%1" lss "%MinT%" ( set MinT=%1 set Best=%2 ) ) goto :eof
CODE: [Copy to clipboard]@echo off echo sz.tencent.com>"QQlist.txt" echo sz1.tencent.com>>"QQlist.txt" echo sz2.tencent.com>>"QQlist.txt" echo sz3.tencent.com>>"QQlist.txt" echo sz4.tencent.com>>"QQlist.txt" echo sz5.tencent.com>>"QQlist.txt" echo sz6.tencent.com>>"QQlist.txt" echo sz7.tencent.com>>"QQlist.txt" set MinL=99 set MinT=9999ms set Best="" for /f "usebackq" %%a in ("QQlist.txt") do ( call :time %%a ) echo 最佳服务器:%Best% echo 最佳服务器的响应时间:%MinT% goto :eof :time for /f "skip=11 tokens=4 delims==" %%a in ('ping %1') do ( if "%%a" equ " 0ms" ( set /a Best=%1 ) else ( call :best %%a %1 ) goto :eof ) :best for /f "skip=1 delims=:" %%a in ('^(echo %1^&echo.^)^|findstr /o ".*"') do set nowlen=%%a if "%nowlen%" lss "%MinL%" ( set /a MinL=%nowlen% set MinT=%1 set Best=%2 ) else if "%nowlen%" equ "%MinL%" ( if "%1" lss "%MinT%" ( set MinT=%1 set Best=%2 ) ) goto :eof
CODE: [Copy to clipboard]@echo off SETLOCAL ENABLEDELAYEDEXPANSION for /f "delims=" %%i in (ip.txt) do ( set st= (ping -n 1 %%i>nul)&&(set st=%%i)||(echo 999ms %%i>>temp1) if defined st for /f "tokens=7 delims== " %%t in ('ping -n 1 %%i^|find /i "Reply from"') do echo %%t %%i>>temp1 ) for /f "tokens=1,2" %%a in (temp1) do ( set t=%%a if "!t:~4,1!"=="" set "t= !t!" echo !t! %%b>>temp2 ) for /f "tokens=1,2" %%a in ('sort temp2') do (echo %%a %%b>result.txt&del temp1 temp2&start result.txt&exit /b)
CODE: [Copy to clipboard]@echo off for /f "delims=" %%a in ('more +11 "%~0"') do for /f "skip=11 tokens=4 delims==" %%i in ('ping %%a') do ( set str=%%i call set str=00000%%str: =%% call set str=%%str:~-5%% call set -%%str%%=%%a ) for /f "tokens=1,2 delims=0-=" %%i in ('set -') do echo %%j %%i&goto end :end pause exit sz.tencent.com sz1.tencent.com sz2.tencent.com sz3.tencent.com sz4.tencent.com sz5.tencent.com sz6.tencent.com sz7.tencent.com
CODE: [Copy to clipboard]@echo off for /f "skip=3 tokens=1-3" %%a in ('ping -n 1 -l 1 sz.tencent.com') do echo %%c >"QQlist.txt" for /f "skip=3 tokens=1-3" %%a in ('ping -n 1 -l 1 sz1.tencent.com') do echo %%c >>"QQlist.txt" for /f "skip=3 tokens=1-3" %%a in ('ping -n 1 -l 1 sz2.tencent.com') do echo %%c >>"QQlist.txt" for /f "skip=3 tokens=1-3" %%a in ('ping -n 1 -l 1 sz3.tencent.com') do echo %%c >>"QQlist.txt" for /f "skip=3 tokens=1-3" %%a in ('ping -n 1 -l 1 sz4.tencent.com') do echo %%c >>"QQlist.txt" for /f "skip=3 tokens=1-3" %%a in ('ping -n 1 -l 1 sz5.tencent.com') do echo %%c >>"QQlist.txt" for /f "skip=3 tokens=1-3" %%a in ('ping -n 1 -l 1 sz6.tencent.com') do echo %%c >>"QQlist.txt" for /f "skip=3 tokens=1-3" %%a in ('ping -n 1 -l 1 sz7.tencent.com') do echo %%c >>"QQlist.txt" set MinL=99 set MinT=9999ms set Best="" for /f "usebackq" %%a in ("QQlist.txt") do ( call :time %%a ) echo 最佳服务器:%Best% echo 最佳服务器的响应时间:%MinT% goto :eof :time for /f "skip=11 tokens=4 delims==" %%a in ('ping %1') do ( if "%%a" equ " 0ms" ( set /a Best=%1 ) else ( call :best %%a %1 ) goto :eof ) :best for /f "skip=1 delims=:" %%a in ('^(echo %1^&echo.^)^|findstr /o ".*"') do set nowlen=%%a if "%nowlen%" lss "%MinL%" ( set /a MinL=%nowlen% set MinT=%1 set Best=%2 ) else if "%nowlen%" equ "%MinL%" ( if "%1" lss "%MinT%" ( set MinT=%1 set Best=%2 ) ) goto :eof
CODE: [Copy to clipboard]@echo off&setlocal enabledelayedexpansion echo 请稍候...... for /f "delims=" %%a in ('more +16 "%~0"') do ( set tx=%%a&set var= for /f "tokens=1-4 delims=[]=" %%i in ('ping %%a^|findstr /i "%%a Average"') do call:LP "%%j" "%%l") for /f "tokens=1,2 delims=-=0" %%i in ('set -') do echo 最快服务器:%%j IP地址:!%%j! 响应时间%%i&goto end :end pause&exit :LP if not defined var set var=%~1 if not %2=="" ( set str=%~2&set str=!str: =! set str=00000000!str!&set str=!str:~-10! set -!str!=%TX%&set %TX%=!var! ) goto :eof sz.tencent.com sz1.tencent.com sz2.tencent.com sz3.tencent.com sz4.tencent.com sz5.tencent.com sz6.tencent.com sz7.tencent.com