::::显示机器名. (从"ComputerCfg.txt"中分离出 机器名字段,并赋给变量"ComputerName")
for /f "skip=2 tokens=1" %%N in (ComputerCfg.txt) do set ComputerName=%%N
@echo %ComputerName%
::::显示IP地址. (从"ComputerCfg.txt"中分离出 IP地址字段,并赋给变量"IPAddress")
for /f "skip=2 tokens=3" %%I in (ComputerCfg.txt) do set IPAddress=%%I
@echo %IPAddress%
::::显示网卡MAC地址.(从"ComputerCfg.txt"中分离出 MAC地址字段,并赋给变量"MacAddress")
for /f "skip=2 tokens=2" %%M in (ComputerCfg.txt) do set MacAddress=%%M
@echo %MacAddress%
for /f "skip=2 tokens=4" %%C in (ComputerCfg.txt) do set strCdkey=%%C
@echo %strCdkey%
::::创建注册表文件
@echo Windows Registry Editor Version 5.00 >ComputerName.reg
@echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName] >>ComputerName.reg
::::显示机器名. (从"ComputerCfg.txt"中分离出 机器名字段,并赋给变量"ComputerName")
for /f "skip=2 tokens=1" %%N in (ComputerCfg.txt) do set ComputerName=%%N
@echo %ComputerName%
::::显示IP地址. (从"ComputerCfg.txt"中分离出 IP地址字段,并赋给变量"IPAddress")
for /f "skip=2 tokens=3" %%I in (ComputerCfg.txt) do set IPAddress=%%I
@echo %IPAddress%
::::显示网卡MAC地址.(从"ComputerCfg.txt"中分离出 MAC地址字段,并赋给变量"MacAddress")
for /f "skip=2 tokens=2" %%M in (ComputerCfg.txt) do set MacAddress=%%M
@echo %MacAddress%
for /f "skip=2 tokens=4" %%C in (ComputerCfg.txt) do set strCdkey=%%C
@echo %strCdkey%
::::创建注册表文件
@echo Windows Registry Editor Version 5.00 >ComputerName.reg
@echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName] >>ComputerName.reg
rem *************** IP地址自动设置程序 ***************
rem 免费程序,可在 GNU 框架下自由分发或/和修改。
rem 程序制作:风流才子 http://www.54caizi.com
rem **************************************************
set find=%SystemRoot%\System32\find.exe
set config=%SystemRoot%\System32\ipconfig.exe
if not "%1" == "%*" goto :syntax
if /I "%1"=="/?" goto :help
if /I "%1"=="/dhcp" goto :godhcp
if /I "%1"=="/static" goto :gostatic
if /I "%1"=="/restore" goto :gorestore
goto :start