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-08-01 22:13
中国DOS联盟论坛 » DOS开发编程 & 发展交流 (开发室) » About modifying the registry with batch commands! View 1,694 Replies 5
Original Poster Posted 2006-04-10 23:49 ·  中国 海南 海口 电信
初级用户
Credits 24
Posts 8
Joined 2006-04-10 23:46
20-year member
UID 53639
Status Offline
Today I encountered a problem when using batch commands to modify the registry! The following is the code I wrote:
@echo off
echo Windows Registry Editor Version 5.00>>ok.reg
echo [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run]>>ok.reg
echo "key"="C:\\WINDOWS\\key.exe">>ok.reg
regedit /s ok.reg
del ok.reg
I don't know if there is any mistake! This is the code in the REG file:
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run]
"key"="C:\\WINDOWS\\key.exe"
I don't understand that I can import it when I write other registry entries. But there are a few that I can't import no matter how I compile them. I have modified them many times repeatedly. It should be no problem. I really can't figure it out. Is it that the command is used incorrectly? Please trouble the experts to give me some advice. I'm almost crazy~~~ If possible, add my QQ: 50594677 and talk to me in detail!
Floor 2 Posted 2006-04-11 13:58 ·  中国 四川 绵阳 电信
高级用户
★★
Credits 587
Posts 282
Joined 2006-04-10 03:40
20-year member
UID 53599
Gender Male
Status Offline
You can use the reg command in the command line window under XP.
QQ:315594066
Floor 3 Posted 2006-04-11 21:21 ·  中国 海南 海口 电信
初级用户
Credits 24
Posts 8
Joined 2006-04-10 23:46
20-year member
UID 53639
Status Offline
Now I want to learn is to modify the registry with batch processing. I already know the REG command. Thanks.
Floor 4 Posted 2006-10-26 12:27 ·  中国 河南 安阳 电信
初级用户
Credits 39
Posts 15
Joined 2006-10-14 07:42
19-year member
UID 65719
Status Offline
Your first line's >> should be >, and a line of echo >>ok.reg should be inserted between the second line and the third line, and that should be okay
Floor 5 Posted 2006-10-26 21:06 ·  中国 四川 成都 教育网
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline
Not being able to import is due to encountering sensitive characters in the batch processing. Try using more +n to generate the reg for quick and error-free results.

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-10-27 03:28 ·  中国 广东 东莞 电信
中级用户
★★
Credits 387
Posts 104
Joined 2004-11-19 00:00
21-year member
UID 33813
Gender Male
Status Offline
Originally posted by electronixtar at 2006-10-26 09:06 PM:
Failure to import is due to encountering batch processing sensitive characters. Try using more +n to generate the reg, which is convenient for quick and error-free operation.



Could you give an example, please
Forum Jump: