Macb0nd. batrem @ echo off
Rem reads the MAC address of the Local Machine
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
Rem reads the local IP Address
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
Rem binds the local IP address and MAC address
ARP-S % IP % Mac %
REM read gateway address
If exist already ip.txt del already ip.txt
Find "Default Gateway" ipconfig.txt> gateip.txt
For/F "Skip = 2 tokens = 13" % G in (ip.txt) do set destination IP = % G
REM read gateway MAC address
If exist gatemac.txt del gatemac.txt
ARP-A % slave IP %> gatemac.txt
For/F "Skip = 3 tokens = 2" % H in (gatemac.txt) do set hosts MAC = % H
Rem binding gateway Mac and IP
ARP-S % gateip % gatemac %
Del ipconfig.txt
Del phyaddr.txt
Del ipaddr.txt
Del paiip.txt
Del gatemac.txt
Rem exit
Vbs script in startup
Dim objshell
Set objshell = wscript. Createobject ("wscript. Shell ")
Rem wscript. Sleep (10000)
Ireturn = objshell. Run ("cmd.exe/C" "D: \ Program Files \ macb0nd. Bat", 0, true)
Result of ARP-A after binding
Interface: 192.168.8.20.--- 0x3
Internet address physical address type
192.168.8.1 00-d0-88-04-f2-5c static
192.168.8.000000-e0-4c-58-e2-d6 static
Vbsset Ws = wscript. Createobject ("wscript. Shell ")
Do
WS. Run "C: \ 0.bat", 0
Wscript. Sleep (10000)
Loop