中国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-01 21:10
48,037 topics / 350,122 posts / today 2 new / 48,249 members
DOS开发编程 & 发展交流 (开发室) » About modifying the registry with batch commands!
Printable Version  1,693 / 5
Floor1 ken0212 Posted 2006-04-10 23:49
初级用户 Posts 8 Credits 24
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!
Floor2 xuantian Posted 2006-04-11 13:58
高级用户 Posts 282 Credits 587
You can use the reg command in the command line window under XP.
QQ:315594066
Floor3 ken0212 Posted 2006-04-11 21:21
初级用户 Posts 8 Credits 24
Now I want to learn is to modify the registry with batch processing. I already know the REG command. Thanks.
Floor4 mydoslg Posted 2006-10-26 12:27
初级用户 Posts 15 Credits 39
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
Floor5 electronixtar Posted 2006-10-26 21:06
铂金会员 Posts 2,672 Credits 7,493
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.
Floor6 zts59 Posted 2006-10-27 03:28
中级用户 Posts 104 Credits 387
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
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023