功能:自动获取电脑IP地址与MAC地址绑定批处理,开机自启动。
有偿
批处理?像这样?
开机自启动+绑定
保存为“IP-MAC.bat”就行吧。
@echo OFF
echo start %~dp0\IP-MAC.bat>"%AppData%\Microsoft\Windows\Start Menu\Programs\Startup\StartRun.bat"
if %~n0==arp exit
if %~n0==Arp exit
if %~n0==ARP exit
arp -d
:IP
FOR /f "skip=13 tokens=15 usebackq " %%i in (`ipconfig /all`) do Set IP=%%i && GOTO MAC
:MAC
echo IP:%IP%
FOR /f "skip=13 tokens=12 usebackq " %%i in (`ipconfig /all`) do Set MAC=%%i && GOTO GateIP
:GateIP
echo MAC:%MAC%
arp -s %IP% %MAC%
FOR /f "skip=17 tokens=13 usebackq " %%i in (`ipconfig /all`) do Set GateIP=%%i && GOTO GateMac
:GateMac
echo IP:%GateIP%
FOR /f "skip=3 tokens=2 usebackq " %%i in (`arp -a %GateIP%`) do Set GateMAC=%%i && GOTO Start
:Start
echo MAC:%GateMAC%
arp -s %GateIP% %GateMAC%
echo 操作完成!!!
exit