- set /p dz=
- echo %dz%>dz.txt
- del 1.txt /q
- for /f "tokens=1-4 delims=." %%a in (dz.txt) do set dza=%%a
- for /f "tokens=1-4 delims=." %%a in (dz.txt) do set dzb=%%b
- for /f "tokens=1-4 delims=." %%a in (dz.txt) do set dzc=%%c
- for /f "tokens=1-4 delims=." %%a in (dz.txt) do set dzd=%%d
- if "%dzd%"=="" goto ttt arp -a %dza%.%dzb%.%dzc%.%dzd%>1.txt
- del dz.txt /q
- del 2.txt /q
- :ttt
- if "%dzd%"=="%dzd%" goto nnn
- for /l %%i in (1,1,254) do arp -a %dza%.%dzb%.%dzc%.%%i>>1.txt
- :nnn
- for /f "tokens=1* delims= " %%i in ('findstr /c:"dynamic" 1.txt') do echo %%i %%j>>2.txt
- for /f "tokens=1* delims= " %%i in ('findstr /c:"static" 1.txt') do echo %%i %%j>>2.txt
- for /f "tokens=1-3 delims= " %%a in (2.txt) do arp -s %%a %%b
复制代码
|