本帖最后由 WHY 于 2016-1-6 22:49 编辑
回复 11# ksla
伤脑筋,我以为能帅好多点的- @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
复制代码
|