ksla 当前离线
一级士官
@echo off & setlocal EnableDelayedExpansion ping 1.1.1.1 -n 1| find "来自">>ip.txt ping 2.2.2.2 -n 1| find "来自">>ip.txt ping 3.3.3.3 -n 1| find "来自">>ip.txt ping 4.4.4.4 -n 1| find "来自">>ip.txt if "%1"=="sub" ( for /f "tokens=1-6" %%a in (ip.txt) do ( set "s= %%e" echo !s:~-10! %%a %%b %%c %%d %%f ) exit ) else ( >ip2.txt ( for /f "tokens=1-6" %%a in ('cmd /c %0 sub ^| sort /r ') do echo %%b %%c %%d %%e %%a %%f) ) for /f "tokens=2-15 delims= " %%i in (ip2.txt) do set zz=%%i echo %zz% findstr /e /v /r /c:"google.com" "C:\Windows\System32\drivers\etc\hosts">>hosts echo %zz% qq.com>>hosts echo %zz% aa.com>>hosts echo %zz% vv.com>>hosts echo %zz% nne.com>>hosts copy hosts "C:\Windows\System32\drivers\etc\hosts" /y del hosts /f /q del ip.txt /f /q del ip2.txt /f /q复制代码
评分人数
TOP
CrLf 当前离线
论坛巡查
@mshta http://bathome.net/s/hta/?%random%^ type('ip.txt').split('\r\n')^ ._EACH(function(s){return {m:s.match(/时间=(\d+)ms/),s:s}})^ .sort(function(a,b){return b.m[1]-a.m[1]})^ ._EACH(function(o){return o.s})^ .join('\r\n') >ip.sort.txt复制代码
pcl_test 当前离线
荣誉版主
@echo off setlocal enabledelayedexpansion for /f "skip=1 tokens=1* delims=m" %%a in ('findstr "时间=" "%~f0"') do ( for /f "tokens=1-3 delims==" %%i in ("%%a") do ( for /f "tokens=2" %%x in ("%%i") do set #%%k=%%x if not defined t ( set t=%%k ) else if %%k leq !t! set t=%%k ) ) echo;%t% !#%t%! pause&exit 来自 1.1.1.1 的回复: 字节=32 时间=111ms TTL=55 来自 2.2.2.2 的回复: 字节=32 时间=11ms TTL=55 来自 3.3.3.3 的回复: 字节=32 时间=96ms TTL=55复制代码
WHY 当前离线
上校
@echo off & setlocal enabledelayedexpansion if "%~1" == "sub" ( for /f "delims=" %%i in (IP.txt) do ( for /f "tokens=3 delims==m" %%j in ("%%i") do set "t=0000000000%%j" echo;!t:~-10! %%i ) ) else ( for /f "tokens=1*" %%i in ('"%~f0" sub ^| sort') do echo;%%j pause & exit )复制代码
@echo off & setlocal enabledelayedexpansion (for %%i in (1.1.1.1 2.2.2.2 3.3.3.3) do ping %%i -n 1)|find "来自">ip.txt set "Min=9999999999" for /f "tokens=2,7 delims==m " %%i in (IP.txt) do ( set "s=0000000000%%j" set "s=!s:~-10!" if "!s!" lss "!Min!" set "Min=!s!" & set "_!Min!=%%i" ) ( findstr /e /v /r /c:"google.com" "%SystemRoot%\System32\drivers\etc\hosts" echo !_%Min%! qq.com echo !_%Min%! aa.com echo !_%Min%! vv.com )>"%~dp0hosts" copy /y "%~dp0hosts" "%SystemRoot%\System32\drivers\etc\hosts" pause复制代码