[会员中心]  [发布文章][发布软件]  [中文繁體]
 文章·资料  电脑软件  手机软件  网站源码
    本 站 搜 索
[选项]
   推 荐 文 章        More...
华硕易电脑(ASUS Eee PC 10..
先来段开场白:为了外出携带方便,..
Acronis True Image 使用..
  一款可以在Windows下使用全..
Norton Ghost 使用详解
一、分区备份   使用Ghost进..
    文 章 阅 读 排 行
Microsoft SQL Server 2000..
  对于第一次安装 Microsoft SQ..
ASP:Dimac W3 JMail 发送..
【发送邮件测试代码下载】压..
ASP:Persits ASPMail 发送..
【发送邮件测试代码下载】压..
VMware Workstation:安装..
编写这份虚拟机安装的图文教程,..
华硕易电脑(ASUS Eee PC 10..
先来段开场白:为了外出携带方便,..
ASP:Microsoft CDO 发送邮..
【发送邮件测试代码下载】压..
 文 章 信 息
Ghost 以后自动修改 机器名 IP地址的批处理文件
评论()〗〖留言〗〖收藏
〖文章分类:电脑·手机·网络 / 电脑软件安装·卸载·设置〗〖阅读选项
@echo off 

:::-------------------------------------------------------------------------- 
:::::请你在使用把[MacAddress] 字段下 改为你自己的机器配置::::::::: 
:::::此文件,只在win2k 专业版下 测试过::::::::::::: 
:::::带有“::::” 后面的语句为 注释:::::::::: 
:::::因为会修改你的机器配置。请在测试机器上使用!::::: 
:::--------------------------------------------------------------------- 

@cls:::清屏 
@echo [ComputerName][MacAddress][IPAddress] [CS-CDKey] >config.cfg 
@echoNh00500-11-5B-CF-C8-12192.168.0.5 3245164654063 >>config.cfg 
@echoNh00600-11-5B-BD-2F-E4192.168.0.6 3385636230783 >>config.cfg 
@echoNh00700-11-5B-B3-F0-86192.168.0.7 2030698167302 >>config.cfg 
@echoNh00800-11-5B-C8-C8-E1192.168.0.8 7149496192146 >>config.cfg 
:::::::添加你自己的机器配置 
::::获取机器的TCP/IP 配置 
if exist ipconfig.txtdel ipconfig.txt 
ipconfig /all >ipconfig.txt 

:::分离出机器的物理地址,并保存到 ( phyaddr.txt) 文件中 
if exist phyaddr.txt del phyaddr.txt 
find"Physical Address" ipconfig.txt >phyaddr.txt 

::::从(c:\phyaddr.txt)文件中取得物理地址字符串,并赋给变量"MacAddress" 
for /f "skip=2 tokens=12" %%M in (phyaddr.txt) do set strMac=%%M 

:::显示物理地址字符串 
@echo %strMac% 

::::以变量"strMac"为关键字搜索(Config.cfg)中相同的字符串行,并保存到(ComputerCfg.txt) 
find "%strMac%" Config.cfg >ComputerCfg.txt 

::::显示机器名. (从"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 

::::用变量"%ComputerName%"去替换实际的机器名 
@echo "ComputerName"="%ComputerName%">>ComputerName.reg 
@echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters] >>ComputerName.reg 

::::用变量"%ComputerName%"去替换实际的机器名 
@echo "NV Hostname"="%ComputerName%">>ComputerName.reg 
@echo "Hostname"="%ComputerName%">>ComputerName.reg 
::::修改 CS-CDKEY 不用管它 
@echo [HKEY_CURRENT_USER\Software\Valve\CounterStrike\Settings]>>ComputerName.reg 
@echo "Key"="%strCdkey%">>ComputerName.reg 
@echo [HKEY_USERS\S-1-5-21-839522115-507921405-2146800195-500\Software\Valve\CounterStrike\Settings]>>ComputerName.reg 
@echo "Key"="%strCdkey%">>ComputerName.reg 

::::导入注册表文件。用的时候把" :: " 去掉 
regedit /s ComputerName.reg 

::::修改IP 地址。用变量"%IPAddress%" 去替换实际的IP 地址 
netsh interface ip set address name="本地连接" source=static addr=%IPAddress% mask=255.255.255.0 gateway=192.168.0.1 gwmetric=1 
::::重起机器批处理! 
setlocal 
cd/d %temp% 
echo [version] > reboot.inf 
set inf=InstallHinfSection DefaultInstall 
echo signature=$chicago$ >> reboot.inf 
echo [defaultinstall] >> reboot.inf 
rundll32 setupapi,%inf% 1 %temp%\reboot.inf 
del reboot.inf 


c: 
cdcd%USERPROFILE%\「开始」菜单\程序\启动 
del /q *.* 

文章作者:未知  更新日期:2005-12-02
〖文章浏览:〗〖打印文章〗〖发送文章
·Ghost备份和恢复系统大法2005-10-09
·运行 Ghost 备份系统就死机2006-05-18
·三种电脑主板导致无法使用ghost恢复安装2005-09-18
·Norton Ghost 使用详解2005-11-03
·Ghost运行错误代码解释2005-11-09
·Ghost运行错误代码解释22005-11-09
·CGI V3.22013-11-12
·ImageX 一键恢复 V11.012014-11-04
·优捷易 Ghost/WIM/ESD 镜像格式转换器 V3.02022-03-30
·Symantec Ghost V8.2/V11.5/V12.0(磁盘/分区备份与恢复)2022-04-09
·Ghost Go! V1.02005-11-05
·GHOST-IP自动更改器2005-12-27
阅读说明
·本站大部分文章转载于网络,如有侵权请留言告知,本站即做删除处理。
·本站法律法规类文章转载自[中国政府网(www.org.cn)],相关法律法规如有修订,请浏览[中国政府网]网站。
·本站转载的文章,不为其有效性,实效性,安全性,可用性等做保证。
·如果有什么问题,或者意见建议,请联系[网站管理员]。
  当百网
  本站使用【啊估文章软件站】网站系统    网站管理员留言簿