本机改好IP后和配制文件比较,
把本机的IP,计算机名,MAC地址提取出来和我放在D盘上的MAC-IP.INI文件里的MAC,计算机名,IP比较要是全相等,就执行一组命令,要是不等提示出错。这个要怎么写,
本机的IP我用别人写的程
————————————————————————————
@echo off
:::::::::读取本机Mac地址
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
:::::::::读取本机ip地址
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
:::::::::读取本机的计算机名
if exist computername.txt del computername.txt
find "Host Name" ipconfig.txt >computername.txt
for /f "skip=2 tokens=16" %%X in (computername.txt) do set Name=%%X
:::::::::绑定本机IP地址和MAC地址
pushd %~dp0
set Mac >>2.txt
set Name >>2.txt
set IP >>2.txt