- @echo on
- 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,91) 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%
-
-
- pause
-
-
- 00-00robocopy "d:\0beifen\newsoft" "\\10.10.127.14\soft\tttoft" /mir /w:2 /r:2
-
- pause
-
-
- 00-00robocopy "d:\0beifen\newsoft" "\\%min127%\soft\tttoft" /mir /w:2 /r:2
-
- pause
复制代码 这个方法,可以满足要求 |