CopyCode The Code is as follows: @ echo off
:::::::::::::::::::::::::::::::::::::::: ::::::::::::
: Batch Processing of binding local hosts, gateway IP addresses, and MAC addresses Program ::
:::::::::::::::::::::::::::::::::::::::: ::::::::::::
ARP-d
:::::::::: Read 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
:::::::::: Read the IP address of the Local Machine
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
:::::::::: Bind the local IP address and MAC address
ARP-S % IP % Mac %
:::::::::: Read the 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
:::::::::: Get the MAC address of the Gateway
Ping 192.168.0.1-N 1
:::::::::: Read the MAC address of the gateway.
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
::::::::: Bind the gateway MAC address and IP address
ARP-S % gateip % gatemac %
Del paiip.txt
Del gatemac.txt
Del ipaddr.txt
Del ipconfig.txt
Del phyaddr.txt
Exit
Copy the above Code and save it as a bat file. Load it to the startup item, so that it can be protected!