For example, there are ten REG files, namely 1.reg to 10.reg. How to append the contents of 2-9 to 1.reg?
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!
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?
>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)@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
@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
@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
)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.> ...