ARP双绑脚本,无临时文件(LZ-Myst版)横线以下内容,保存为BAT格式即可用了。 代码如下: for /f "tokens=13" %%I in ('ipconfig /all ^|find "Default Gateway"') do set GatewayIP=%%I for /f "tokens=1,2" %%I in ('arp -a ^|find "%GatewayIP%"') do if %%I==%GatewayIP% arp -s %%I %%J for /f "tokens=15" %%i in ('ipconfig /all ^|find "IP Address"') do set ip=%%i for /f "tokens=12" %%i in ('ipconfig /all ^|find "Physical Address"') do set mac=%%i arp -s %ip% %mac%
把下面代码框中的红字改成你的真实MAC地址!!! MAC地址格式为:00-14-78-32-14-f2 就是ARP -A显示的格式。 代码如下: for /f "tokens=13" %%I in ('ipconfig /all ^|find "Default Gateway"') do set GatewayIP=%%I arp -s %GatewayIP% 真实网关MAC for /f "tokens=15" %%i in ('ipconfig /all ^|find "IP Address"') do set ip=%%i for /f "tokens=12" %%i in ('ipconfig /all ^|find "Physical Address"') do set mac=%%i arp -s %ip% %mac%