- setlocal enabledelayedexpansion
-
- for /l %%i in (12,1,227) do (
- ping 10.10.127.%%i -n 1 -w 300 >nul 2>nul&& (set min127=10.10.127.%%i&goto next)
- )
- :next
- for /l %%j in (200,1,226) do (
- ping 10.10.94.%%j -n 1 -w 300 >nul 2>nul&& (set min94=10.10.94.%%j&goto next1)
- )
- :next1
- for /l %%k in (87,1,191) do (
- ping 10.10.93.%%k -n 1 -w 300 >nul 2>nul&& (set min93=10.10.93.%%k&goto next2)
- )
- :next2
- for /l %%m in (142,1,236) do (
- ping 10.10.9.%%m -n 1 -w 300 >nul 2>nul&& (set min9=10.10.9.%%m&goto :end)
- )
- :end
-
- echo %min127%
- echo %min94%
- echo %min93%
- echo %min9%
复制代码 问题解决。 |