|
nvflash
初级用户
 
积分 126
发帖 38
注册 2006-9-26
状态 离线
|
『楼 主』:
写一个文件,把多个REG合并成一个
使用 LLM 解释/回答一下
比如,有十个REG文件,分别为1.reg到10.reg
要把2-9的内容追加到1.reg里面,怎么弄?
For example, there are ten REG files, namely 1.reg to 10.reg. How to append the contents of 2-9 to 1.reg?
|
|
2006-9-29 19:24 |
|
|
NaturalJ0
银牌会员
    
积分 1181
发帖 533
注册 2006-8-14
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
copy 1.reg+2.reg+3.reg+......+10.reg 0.reg
这样行么?
Can this work?
|
|
2006-9-29 20:15 |
|
|
9527
银牌会员
     努力做坏人
积分 1185
发帖 438
注册 2006-8-28 来自 北京
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
不太明白楼主什么意思?是10个REG文件中的2.reg到9.reg内容合并啊?还是每个文件的2-9行中的内容合并成一个啊?题意没说清楚!!!
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!!!
|

我今后在论坛的目标就是做个超级坏人!!! |
|
2006-9-29 21:34 |
|
|
chainliq
高级用户
    学无尽止
积分 635
发帖 244
注册 2006-4-15 来自 广西贵港
状态 离线
|
|
2006-9-29 21:36 |
|
|
chainliq
高级用户
    学无尽止
积分 635
发帖 244
注册 2006-4-15 来自 广西贵港
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
这样也行:
@echo off
regedit /s 路径\1.reg
regedit /s 路径\2.reg
regedit /s 路径\3.reg
**************
This is also okay:
@echo off
regedit /s 路径\1.reg
regedit /s 路径\2.reg
regedit /s 路径\3.reg
**************
|
|
2006-9-29 21:39 |
|
|
nvflash
初级用户
 
积分 126
发帖 38
注册 2006-9-26
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
Originally posted by NaturalJ0 at 2006-9-29 20:15:
copy 1.reg+2.reg+3.reg+......+10.reg 0.reg
这样行么?
这样是可以了,但合并后是这种的格式,并不能直接导入注册表:
Windows Registry Editor Version 5.00
"KureeBak"="dsafs"
@="mplayerc.3gp"
Windows Registry Editor Version 5.00
@="WinRAR"
有两个文件头了
可以在word里面查找^P,替换成 就行了
那么有没有办法直接就把文件头给去了?
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?
|
|
2006-9-29 22:05 |
|
|
zh159
金牌会员
     
积分 3687
发帖 1467
注册 2005-8-8
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
试试:
>Tmp.reg echo Windows Registry Editor Version 5.00
>>Tmp.reg echo.
for /f "delims=" %%i in ('dir/b *.reg') do (
for /f "skip=1 delims=" %%n in (%%i) do if not "%%i"=="Tmp.reg" >>Tmp.reg echo %%n)
Try:
>Tmp.reg echo Windows Registry Editor Version 5.00
>>Tmp.reg echo.
for /f "delims=" %%i in ('dir/b *.reg') do (
for /f "skip=1 delims=" %%n in (%%i) do if not "%%i"=="Tmp.reg" >>Tmp.reg echo %%n)
|
|
2006-9-29 22:26 |
|
|
pengfei
银牌会员
    
积分 1218
发帖 485
注册 2006-7-21 来自 湖南.娄底
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
2楼的copy +..+不错~~~!
@echo off
copy /b /y 1.txt+2.txt+3.txt+4.txt+5.txt+6.txt+7.txt+8.txt+9.txt+10.txt temp.txt
for /l %%i in (1,1,10) do del %%i.txt
ren temp.txt 1.txt
pause
不过似乎有更好的办法...
@@echo off
for /l %%i in (2,1,10) do type %%i.txt>>1.txt
for /l %%i in (2,1,10) do del %%i.txt
pause
The copy +..+ is good~~~!
@echo off
copy /b /y 1.txt+2.txt+3.txt+4.txt+5.txt+6.txt+7.txt+8.txt+9.txt+10.txt temp.txt
for /l %%i in (1,1,10) do del %%i.txt
ren temp.txt 1.txt
pause
But it seems there is a better way...
@@echo off
for /l %%i in (2,1,10) do type %%i.txt>>1.txt
for /l %%i in (2,1,10) do del %%i.txt
pause
|
|
2006-9-29 23:57 |
|
|
namejm
荣誉版主
       batch fan
积分 5226
发帖 1737
注册 2006-3-10 来自 成都
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
通行的方案是:在for语句中用 mor +1 跳过2~10.reg文件的首行,然后再把剩余行的内容echo到1.reg文件内容的后面。代码如下:
@echo off
echo.>>1.reg
for /l %%i in (2,1,10) do (
echo.>>1.reg
for /f "tokens=*" %%j in ('more +1 %%i.reg') do (
>>1.reg echo %%j
)
)
start notepad 1.reg
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:
@echo off
echo.>>1.reg
for /l %%i in (2,1,10) do (
echo.>>1.reg
for /f "tokens=*" %%j in ('more +1 %%i.reg') do (
>>1.reg echo %%j
)
)
start notepad 1.reg
|

尺有所短,寸有所长,学好CMD没商量。
考虑问题复杂化,解决问题简洁化。 |
|
2006-9-30 01:01 |
|
|
zh159
金牌会员
     
积分 3687
发帖 1467
注册 2005-8-8
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
改正一下我 7 楼的,只要把 reg 文件放在同一目录
@echo off
>Tmp.reg echo Windows Registry Editor Version 5.00
for /f "delims=" %%i in ('dir/on/b *.reg') do (
>>Tmp.reg echo.
for /f "skip=1 delims=" %%n in (%%i) do if not "%%i"=="Tmp.reg" >>Tmp.reg echo %%n
)
Correct your 7th floor, just put the reg file in the same directory
@echo off
>Tmp.reg echo Windows Registry Editor Version 5.00
for /f "delims=" %%i in ('dir/on/b *.reg') do (
>>Tmp.reg echo.
for /f "skip=1 delims=" %%n in (%%i) do if not "%%i"=="Tmp.reg" >>Tmp.reg echo %%n
)
|
|
2006-9-30 01:17 |
|
|
nvflash
初级用户
 
积分 126
发帖 38
注册 2006-9-26
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
Originally posted by namejm at 2006-9-30 01:01:
通行的方案是:在for语句中用 mor +1 跳过2~10.reg文件的首行,然后再把剩余行的内容echo到1.reg文件内容的后面。代码如下:
@echo off
echo.> ...
真是个高手!
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:
@echo off
echo.> ...
Really a master!
|
|
2006-9-30 02:03 |
|
|
pengfei
银牌会员
    
积分 1218
发帖 485
注册 2006-7-21 来自 湖南.娄底
状态 离线
|
『第 12 楼』:
使用 LLM 解释/回答一下
namejm兄的去头行显示再重定向很好...
Windows Registry Editor Version 5.00
而1.reg中反复出现这句不会对导入造成影响.
Last edited by pengfei on 2006-9-30 at 02:18 ]
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 ]
|
|
2006-9-30 02:12 |
|
|
3742668
荣誉版主
      
积分 2013
发帖 718
注册 2006-2-18
状态 离线
|
『第 13 楼』:
使用 LLM 解释/回答一下
@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.若没有在参数中指定要合并的reg文件,默认合并当前目录下所有的reg文件。
2.代码未测试。
```
@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.
|
|
2006-9-30 13:01 |
|