ECHO :::: 中国信息港导入mac地址到ipconfig.txt ::::
::::获取机器的TCP/IP 配置
代码如下 | 复制代码 |
if exist ipconfig.txt del D:pichuliipconfig.txt ipconfig /all >D:pichuliipconfig.txt |
::::分离出机器的物理地址,并保存到 ( phyaddr.txt) 文件中
代码如下 | 复制代码 |
if exist D:pichuliphyaddr.txt del D:pichuliphyaddr.txt find "Physical Address" D:pichuliipconfig.txt >D:pichuliphyaddr.txt |
::::分离出机器的IP地址,并保存到ip.txt中
代码如下 | 复制代码 |
if exist D:pichuliip.txt del D:pichuliip.txt find "IP Address" D:pichuliipconfig.txt >D:pichuliip.txt Set sc=2 :scan |
::::从(D:pichuliphyaddr.txt)文件中取得物理地址字符串,并赋给变量"MacAddress"
代码如下 | 复制代码 |
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 目标地址MAC: %strMac% >>D:pichulimac.txt ECHO 目标地址MAC: %IPAddress% >>D:pichuliGetIp.txt |
:::中国信息港绑定mac与ip
代码如下 | 复制代码 |
arp -s %IPAddress% %strMac% >> |
C:Documents and SettingsAdministrator「开始」菜单程序启动ip_mac.cmdecho http://www.111cn.net
时间: 2024-10-29 15:08:11