本帖最后由 buyiyang 于 2023-3-22 22:43 编辑
- setlocal enabledelayedexpansion
- chcp 65001
- for /f "tokens=1,2" %%i in (IP.txt) do (
- set /a m+=1
- for /f "tokens=3 delims=," %%a in ('ping -l 2000 -n 5 %%i ^| findstr /i /c:"Average"') do (
- set /a n+=1
- set "ag=%%a"
- set "ag=!ag:ms=!
- set /a !ag!
- if !Average! gtr 3 (echo %%j网络延迟!ag!>>故障统计.txt) else (echo %%j网络正常)
- )
- if !m! neq !n! (
- echo %%j网络故障>>故障统计.txt
- set /a n=!m!
- )
- )
复制代码
|