中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-25 23:42
47,812 topics / 349,910 posts / today 0 new / 48,264 members
DOS批处理 & 脚本技术(批处理室) » Write a file that combines multiple REG files into one
Printable Version  3,304 / 12
Floor1 nvflash Posted 2006-09-29 19:24
初级用户 Posts 38 Credits 126
For example, there are ten REG files, namely 1.reg to 10.reg. How to append the contents of 2-9 to 1.reg?
Floor2 NaturalJ0 Posted 2006-09-29 20:15
银牌会员 Posts 533 Credits 1,181
Can this work?
Floor3 9527 Posted 2006-09-29 21:34
银牌会员 Posts 438 Credits 1,185 From 北京
I don't quite understand what the original poster means? Is it merging the contents from 2.reg to 9.reg among the 10 REG files? Or merging the contents from lines 2 to 9 of each file into one? The problem statement is not clear!!!
Floor4 chainliq Posted 2006-09-29 21:36
高级用户 Posts 244 Credits 635 From 广西贵港
Floor5 chainliq Posted 2006-09-29 21:39
高级用户 Posts 244 Credits 635 From 广西贵港
This is also okay:
@echo off
regedit /s 路径\1.reg
regedit /s 路径\2.reg
regedit /s 路径\3.reg
**************
Floor6 nvflash Posted 2006-09-29 22:05
初级用户 Posts 38 Credits 126
Originally posted by NaturalJ0 at 2006-9-29 20:15:
Can this work? copy 1.reg+2.reg+3.reg+......+10.reg 0.reg

This is okay, but after merging, it's in this format and can't be directly imported into the registry:
Windows Registry Editor Version 5.00


"KureeBak"="dsafs"
@="mplayerc.3gp"

Windows Registry Editor Version 5.00


@="WinRAR"

There are two file headers.
You can find ^P in Word and replace it with nothing.

Then is there a way to directly remove the file headers?
Floor7 zh159 Posted 2006-09-29 22:26
金牌会员 Posts 1,467 Credits 3,687
Try:
Floor8 pengfei Posted 2006-09-29 23:57
银牌会员 Posts 485 Credits 1,218 From 湖南.娄底
The copy +..+ is good~~~!



But it seems there is a better way...

Floor9 namejm Posted 2006-09-30 01:01
荣誉版主 Posts 1,737 Credits 5,226 From 成都
The common solution is: In the for statement, use mor +1 to skip the first line of the 2 ~ 10.reg files, and then echo the content of the remaining lines to the back of the content of the 1.reg file. The code is as follows:
Floor10 zh159 Posted 2006-09-30 01:17
金牌会员 Posts 1,467 Credits 3,687
Correct your 7th floor, just put the reg file in the same directory

Floor11 nvflash Posted 2006-09-30 02:03
初级用户 Posts 38 Credits 126
Originally posted by namejm at 2006-9-30 01:01:
The common approach is: in the for statement, use mor +1 to skip the first line of the 2~10.reg files, and then echo the remaining lines to the back of the content of the 1.reg file. The code is as follows:
Floor12 pengfei Posted 2006-09-30 02:12
银牌会员 Posts 485 Credits 1,218 From 湖南.娄底
Brother namejm's method of removing the first line and then redirecting is very good...

Windows Registry Editor Version 5.00
And the repeated occurrence of this line in 1.reg will not affect the import.

[ Last edited by pengfei on 2006-9-30 at 02:18 ]
Floor13 3742668 Posted 2006-09-30 13:01
荣誉版主 Posts 718 Credits 2,013
```
@echo off
set filter=Windows Registry Editor Version 5.00
if "%1" == "" (set file=*.reg) else (set file=%*)

(echo %filter%) >xxx.txt
(type %file% | findstr /ixvc:"%filter%") >>xxx.txt

del %file%
ren xxx.txt xxx.reg

```
1. If no reg file to merge is specified in the parameter, it defaults to merging all reg files in the current directory.
2. The code is not tested.
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023