规避 time<1ms 的情况:- @echo off&setlocal enabledelayedexpansion
- :a
- set ip=!random:~1,2!.!random:~1,2!.!random:~1,2!.!random:~1,2!
- (for /f "eol= tokens=3 delims==<" %%i in ('ping %ip% -n 2 -l 888') do (
- set "ms=%%i"&set /p"=!ms:~0,-6!"<nul>>ms.txt&echo;>>ms.txt&goto :a
- )
- )||(ping 127.0.0.1 -n 1 >nul 2>nul&goto :a)
复制代码 测试- @echo off&Title 测试&setlocal enabledelayedexpansion
- :a
- set ip=!random:~1,2!.!random:~1,2!.!random:~1,2!.!random:~1,2!
- (for /f "eol= tokens=3 delims==<" %%i in ('ping %ip% -n 2 -l 888') do (
- set "ms=%%i"&set /p"=!ms:~0,-6! %ip%"<nul>>ms.txt&echo;>>ms.txt
- set /a b+=1&Title %ip% !b!个地址&goto :a
- )
- )||(set /a a+=1&Title %ip% !a!个失效&ping 127.0.0.1 -n 1 >nul 2>nul&goto :a)
复制代码
|