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%