@
echo off
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
for /f "tokens=2-15 delims= " %%i in (ip.txt) do set ip1=%%i
echo %ip1%
findstr /e /v /r /c:"
aaa.com" "C:\Windows\System32\drivers\etc\hosts">>hosts
echo %ip1%
bbb.com>>hosts
echo %ip1%
ccc.google.com>>hosts
echo %ip1%
ddd.com>>hosts
echo %ip1%
eee.com>>hosts
copy hosts "C:\Windows\System32\drivers\etc\hosts" /y
ping 4.4.4.4 -n 1| find "来自">>ip.txt
ping 5.5.5.5 -n 1| find "来自">>ip.txt
ping 6.6.6.6 -n 1| find "来自">>ip.txt
for /f "tokens=2-15 delims= " %%i in (ip.txt) do set ip2=%%i
echo %ip2%
findstr /e /v /r /c:"
google.com" "C:\Windows\System32\drivers\etc\hosts">>hosts
echo %ip2%
111.com>>hosts
echo %ip2%
222.com>>hosts
echo %ip2%
333.com>>hosts
echo %ip2%
444.com>>hosts
copy hosts "C:\Windows\System32\drivers\etc\hosts" /y
del hosts /f /q
for /f "tokens=2-15 delims= " %%i in (ip.txt) do set ip1=%%i
for /f "tokens=2-15 delims= " %%i in (ip.txt) do set ip2=%%i
请问此行如何修改才能达到以下功能,各自取最小的响应时间的 IP 为%ip1%和%ip2%
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
https://www.v2ex.com/t/248749
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.