China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

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!

中国DOS联盟论坛
The time now is 2026-07-05 07:23
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Help: How to convert a registry file into a batch file View 5,154 Replies 31
Original Poster Posted 2006-11-09 08:25 ·  中国 安徽 芜湖 电信
高级用户
★★★
Credits 906
Posts 346
Joined 2006-07-10 09:58
19-year member
UID 58334
Gender Male
Status Offline
It is to convert REG files to CMD or BAT files. I have been seeking for a long time in various forums, and I got it here with the guidance of an expert:
Floor 2 Posted 2006-11-09 09:03 ·  中国 甘肃 甘南藏族自治州 合作市 电信
金牌会员
★★★★
Credits 4,103
Posts 1,744
Joined 2006-01-20 13:00
20-year member
UID 49241
Gender Male
From 甘肃.临泽
Status Offline
You need to first export a random registry file casually, and then look at the help of reg /?
Use for to process files, try it by yourself, and come ask again if you have unclear places! You directly asking for code like this, I'm afraid it's not the best solution!
Floor 3 Posted 2006-11-09 09:43 ·  中国 上海 松江区 电信
铂金会员
★★★★
DOS一根葱
Credits 5,493
Posts 2,315
Joined 2006-05-01 10:41
20-year member
UID 54766
Gender Male
From 上海
Status Offline
There is another~~~~~~~~~~

@echo off
echo REGEDIT4>tmp.reg
echo.>>tmp.reg
echo >>tmp.reg
echo @="CMD Command Prompt">>tmp.reg
echo >>tmp.reg
echo @="cmd.exe /k \"cd %L\"">>tmp.reg
echo >>tmp.reg
echo @="CMD Command Prompt"
echo >>tmp.reg
echo @="cmd.exe /k \"cd %L\"">>tmp.reg
echo.>>tmp.reg
regedit /s tmp.reg
del tmp.reg
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
redtek +5 2006-11-23 01:18
第一高手 第二高手

Floor 4 Posted 2006-11-09 10:30 ·  中国 安徽 芜湖 电信
高级用户
★★★
Credits 906
Posts 346
Joined 2006-07-10 09:58
19-year member
UID 58334
Gender Male
Status Offline
Thanks to the enthusiastic hearts of the two friends
Floor 5 Posted 2006-11-09 10:42 ·  中国 四川 成都 教育网
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline
Suggestion: Let's make a reg2bat.bat batch script? Automatically convert.reg to a batch script with reg commands?

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
Floor 6 Posted 2006-11-09 10:55 ·  中国 安徽 芜湖 电信
高级用户
★★★
Credits 906
Posts 346
Joined 2006-07-10 09:58
19-year member
UID 58334
Gender Male
Status Offline
5th floor boss. You have expressed the aspirations of newbies like us. Support you on behalf of newbies
Floor 7 Posted 2006-11-09 10:58 ·  中国 安徽 芜湖 电信
高级用户
★★★
Credits 906
Posts 346
Joined 2006-07-10 09:58
19-year member
UID 58334
Gender Male
Status Offline
Proposal: Let's make a reg2bat.bat batch script? Automatically convert.reg to reg command batch script.

Friends who need it, please post replies.
Floor 8 Posted 2006-11-09 21:03 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
19-year member
UID 59080
Status Offline

  Well, it's completely necessary...
Floor 9 Posted 2006-11-09 21:11 ·  中国 河北 廊坊 三河市 移动
金牌会员
★★★★
Credits 2,725
Posts 1,160
Joined 2006-09-23 12:00
19-year member
UID 63486
From 河北廊坊
Status Offline
That's a great idea! I want it.
三人行,必有吾师焉。 学然后知不足,教然后知困,然后能自强也。
Floor 10 Posted 2006-11-10 00:09 ·  中国 四川 南充 电信
超级版主
★★★★
我爱DOS
Credits 5,310
Posts 2,044
Joined 2005-09-26 12:00
20-year member
UID 42843
Gender Male
From 四川南充
Status Offline
I'm not sure what specific transformation or further processing you want for this content. But if you just need to present the existing text as is after translation (since the main content is code and the Chinese part is about creating a batch script to convert sz.reg to reg.bat), the translated text would be:

I'll make a batch script that converts sz.reg to reg.bat
@echo off
for /f "tokens=*" %%a in ('type sz.reg') do echo echo %%a^>^>tmp.reg>>reg.bat
echo echo regedit /s tmp.reg>>reg.bat
Recent Ratings for This Post ( 2 in total) Click for details
RaterScoreTime
redtek +5 2006-11-23 01:20
fastrun +1 2006-12-14 02:21
Floor 11 Posted 2006-11-10 00:18 ·  中国 四川 成都 教育网
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline
Have the special characters been handled? My idea is to convert into 3 versions:
1. reg.exe version
2. generated by more
3. generated by echo

By the way, it is suggested that the moderator separate the topics, thank you!

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
Floor 12 Posted 2006-11-10 00:18 ·  中国 广西 贵港 电信
初级用户
Credits 130
Posts 10
Joined 2004-10-23 00:00
21-year member
UID 32844
Gender Male
Status Offline
Learning
Floor 13 Posted 2006-11-11 06:06 ·  中国 河北 廊坊 三河市 移动
金牌会员
★★★★
Credits 2,725
Posts 1,160
Joined 2006-09-23 12:00
19-year member
UID 63486
From 河北廊坊
Status Offline
Looking forward to further improvement!
三人行,必有吾师焉。 学然后知不足,教然后知困,然后能自强也。
Floor 14 Posted 2006-11-11 07:49 ·  中国 甘肃 甘南藏族自治州 合作市 电信
金牌会员
★★★★
Credits 4,103
Posts 1,744
Joined 2006-01-20 13:00
20-year member
UID 49241
Gender Male
From 甘肃.临泽
Status Offline
It's good to make this version of reg.exe, heh heh
Floor 15 Posted 2006-11-16 20:40 ·  美国 科罗拉多州 阿拉珀霍 利特尔顿 TW_Telecom控股股份有限公司
初级用户
Credits 35
Posts 18
Joined 2006-04-26 13:31
20-year member
UID 54481
Status Offline
Originally posted by fastslz at 2006-11-9 09:43:
Also ~~~~~~~~~~

@echo off
echo REGEDIT4>tmp.reg
echo.>>tmp.reg
echo >>tmp.reg
echo @="CMD Command Prompt">>tmp.r ...

High!
Forum Jump: