ARP本机绑定的bat代码
程序员文章站
2022-06-23 18:58:24
复制代码 代码如下: @echo off if exist ipconfig.txt del ipconfig.txt ipconfig /all >ipconfig...
复制代码 代码如下:
@echo off
if exist ipconfig.txt del ipconfig.txt
ipconfig /all >ipconfig.txt
if exist phyaddr.txt del phyaddr.txt
find "physical address" ipconfig.txt >phyaddr.txt
for /f "skip=2 tokens=12" %%m in (phyaddr.txt) do set mac=%%m
if exist ipaddr.txt del ipaddr.txt
find "ip address" ipconfig.txt >ipaddr.txt
for /f "skip=2 tokens=15" %%i in (ipaddr.txt) do set ip=%%i
arp -s %ip% %mac%
del ipaddr.txt
del ipconfig.txt
del phyaddr.txt
exit
对for命令不熟悉的朋友可以参考这篇文章
上一篇: 乐播投屏怎么用 乐播投屏常见问题汇总分享
下一篇: 黑客基础之DOS (最齐全)超强推荐