- @echo off
- for /f "tokens=2 delims==" %%i in ('wmic Path Win32_NetworkAdapterConfiguration where "IPEnabled='True'" get DefaultIPGateway /value ^| findstr "="') do (
- set "gateway=%%i"
- )
- set "gateway=%gateway:~2,-3%"
- REM echo %gateway%
- for %%i in (%gateway%) do (
- set "suffix=%%~xi"
- set "prefix=%%~ni"
- )
- set /a next=%suffix:~1%+1
- set IP=%prefix%.%next%
- REM echo %IP%
- ping -n 1000 %IP% > "网络质量.txt"
复制代码
|