
CODE: [Copy to clipboard]@echo off
FOR /f "tokens=14 delims=: " %%i in ('ipconfig /all ^|find /i "IP Address"') do Set ip=%%i
FOR /f "tokens=11 delims=: " %%i in ('ipconfig /all ^|find /i "Physical Address"') do Set mac=%%i
echo arp -s %IP% %MAC%>c:\ipmac.bat
FOR /f "tokens=12 delims=: " %%i in ('ipconfig /all ^|find /i "Default Gateway"') do Set GateIP=%%i
FOR /f "skip=3 tokens=2" %%b in ('arp -a %GateIP%') do (
Set GateMAC=%%b
goto gate
)
:gate
echo arp -s %Gateip% %GateMAC%>>c:\ipmac.bat
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |