
CODE: [Copy to clipboard]@echo off
:gateip
for /f "tokens=13" %%a in ('ipconfig /all ^| findstr /i "Default Gateway"') do (
set gwip=%%a
goto :gatemac
)
:gatemac
>nul ping %gwip%
for /f "tokens=2" %%a in ('arp -a ^| findstr /i "%gwip%"') do (
set gwmac=%%a
goto :output
)
:output
>"123.bat" echo (arp -s %gwip% %gwmac%)^&^&(msg %%username%% 绑定成功)
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |