ECHO: import macaddress to ipconfig.txt ::::
:::: Get the machine's TCP/IP configuration
The code is as follows: |
Copy code |
If exist ipconfig.txt del D: pichuliipconfig.txt Ipconfig/all> D: pichuliipconfig.txt |
:::: Detach the physical address of the machine and save it to the (phyaddr.txt) file.
The code is as follows: |
Copy code |
If exist D: pichuliphyaddr.txt del D: pichuliphyaddr.txt Find "Physical Address" D: pichuliipconfig.txt> D: pichuliphyaddr.txt |
:::: Separate the IP address of the machine and save it to ip.txt.
The code is as follows: |
Copy code |
If exist D: pichuliip.txt del D: pichuliip.txt Find "IP Address" D: pichuliipconfig.txt> D: pichuliip.txt Set SC = 2 Set scfile = D: pichuliphyaddr.txt Set scfile2 = D: pichuliip.txt Goto scan
: Scan |
:::: Obtain the physical address string from the (D: pichuliphyaddr.txt) file and assign it to the variable "MacAddress"
The code is as follows: |
Copy code |
For/f "skip = 2 tokens = 12" % M in (% scfile %) do set strMac = % M For/f "skip = 2 tokens = 15" % I in (% scfile2 %) do set IPAddress = % I If exist D: pichulimac.txt del D: pichulimac.txt If exist D: pichuliip2.txt del D: pichuliGetIp.txt ECHO target address MAC: % strMac %> D: pichulimac.txt ECHO target address MAC: % IPAddress %> D: pichuliGetIp.txt |
: China information port bound mac and ip
The code is as follows: |
Copy code |
Arp-s % IPAddress % strMac %> |
C: Documents and SettingsAdministrator start the ip_mac.cmdecho http://www.111cn.net