您现在的位置: 天下网吧 >> 网吧天地 >> 天下码农 >> 前端开发 >> 正文

CS自动根据MAC地址分配 CD KEY修改显示设置的批处理

2008-6-29天下网盟yeyng

@ECHO OFF
@CLS
@ECHO [COMPUTERNAME] [MACADDRESS] [IPADDRESS] [CS-CDKEY] >CONFIG.CFG
@ECHO X01 00-E0-4C-C7-B3-88 192.168.0.11 3005789616110 >>CONFIG.CFG
@ECHO X02 00-E0-4C-80-5D-14 192.168.0.12 3005789616110 >>CONFIG.CFG
@ECHO X03 00-C0-26-AB-0A-E6 192.168.0.13 3005789616110 >>CONFIG.CFG
@ECHO X04 00-E0-4C-B6-32-EB 192.168.0.14 3005789616110 >>CONFIG.CFG
@ECHO X05 00-E0-4C-A0-41-11 192.168.0.15 3005789616110 >>CONFIG.CFG
@ECHO X06 00-E0-4C-21-7D-68 192.168.0.16 2498521763020 >>CONFIG.CFG
@ECHO X07 00-E0-4C-81-C0-44 192.168.0.17 2498521763020 >>CONFIG.CFG
@ECHO X08 00-E0-4C-21-7D-7B 192.168.0.18 2498521763020 >>CONFIG.CFG
@ECHO X09 00-E0-4C-C1-7F-BF 192.168.0.19 2498521763020 >>CONFIG.CFG
@ECHO X10 00-E0-4C-A0-F8-6C 192.168.0.20 2498521763020 >>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
::从(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%
::写入注册表
IF EXIST INSTALL.REG DEL INSTALL.REG
@ECHO Windows Registry Editor Version 5.00 >>INSTALL.REG
@ECHO [HKEY_CURRENT_USER\Software\Valve] >>INSTALL.REG
@ECHO [HKEY_CURRENT_USER\Software\Valve\CounterStrike] >>INSTALL.REG
@ECHO "InstallPath"="D:\\GAMES\\CS反恐精英1.5" >>INSTALL.REG
@ECHO "Full Name"="Half-Life: Counter-Strike" >>INSTALL.REG
@ECHO [HKEY_CURRENT_USER\Software\Valve\CounterStrike\Recent File List] >>INSTALL.REG
@ECHO [HKEY_CURRENT_USER\Software\Valve\CounterStrike\Settings] >>INSTALL.REG
@ECHO "key"="%STRCDKEY%" >>INSTALL.REG
@ECHO "Version"=dword:00000001 >>INSTALL.REG

欢迎访问最专业的网吧论坛,无盘论坛,网吧经营,网咖管理,网吧专业论坛 https://bbs.txwb.com

关注天下网吧微信/下载天下网吧APP/天下网吧小程序,一起来超精彩

本文来源:天下网盟 作者:yeyng

声明
声明:本站所发表的文章、评论及图片仅代表作者本人观点,与本站立场无关。若文章侵犯了您的相关权益,请及时与我们联系,我们会及时处理,感谢您对本站的支持!联系邮箱:support@txwb.com,系统开号,技术支持,服务联系QQ:1175525021本站所有有注明来源为天下网吧或天下网吧论坛的原创作品,各位转载时请注明来源链接!
天下网吧 网吧天下