文章·资料 电脑软件 手机应用 网站源码




    本 站 搜 索
   推 荐 文 章        More...
华硕易电脑(ASUS Eee PC 1025C..
先来段开场白:为了外出携带方便,到淘..
Acronis True Image 使用说明
  一款可以在Windows下使用全部功..
Norton Ghost 使用详解
一、分区备份   使用Ghost进行系..
    文 章 阅 读 排 行
手机视频监控 APP 关闭广告:萤..
一、萤石云视频:我的,设置,隐私设置,..
常见数据库介绍与对比(SQL Serv..
常见数据库的对比分析,涵盖你提到的 A..
Windows 系统修改默认文件类型..
Windows 系统文件类型图标,通常由默..
Windows 系统安装或备份时 ISO,..
【ISO 文件】 ISO 文件其实就是光..
Microsoft SQL Server 2000 Per..
  对于第一次安装 Microsoft SQL Se..
颜色与英文单词对照
颜色与英文单词对照 red green bl..
PakePlus 构建 APP 需要 Github..
PakePlus 是一个基于 Rust Tauri 的..
主页真的越Google、越简洁越好吗
  如果你在11月10日早上打开雅虎中..
网络工程师必懂的专业术语
路由器问题:1、什么时候使用多路由协..
为啥现在的电脑都不能安装 Wind..
说实话,这几年如果你尝试在新电脑..
 文 章 信 息
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
〖文章浏览:〗〖发送文章〗〖打印文章
相关文章 ·Norton Ghost 使用详解2005-11-03
·三种电脑主板导致无法使用ghost恢复安装2005-09-18
·Ghost备份和恢复系统大法2005-10-09
·运行 Ghost 备份系统就死机2006-05-18
·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