windows 使用 .reg 文件将字符串值添加到注册表时出现问题
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5510109/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Problem in adding string value to registry with .reg file
提问by Morin
I'm on win2k3 machine. I wrote a .reg file as below:
我在win2k3机器上。我写了一个 .reg 文件如下:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\KalleService\Parameters]
"Application"="C:\Projects\KalleService\Bin\KalleService.exe"
When double click the .reg file/say merge, it says registry modified successfully. But it has just created the Parameters
key and has not created Application
string value.
当双击 .reg 文件/say 合并时,它说注册表修改成功。但它刚刚创建了Parameters
键,并没有创建Application
字符串值。
What could be the problem?
可能是什么问题呢?
回答by Sarfraz Ahmed
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\KalleService\Parameters]
"Application"="C:\Projects\KalleService\Bin\KalleService.exe"
try double slashes(\\
) instead of single slash (\
) in the string value.
尝试在字符串值中使用双斜线 ( \\
) 而不是单斜线 ( \
) 。
回答by saksham verma
try this:
尝试这个:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\KalleService\Parameters]
@=" "
"Application"="\"C:\Projects\KalleService\Bin\KalleService.exe\""
or if this doesn't work make a key manually with a value and export it (a .reg file will be created)
或者如果这不起作用,请手动创建一个带有值的密钥并将其导出(将创建一个 .reg 文件)
open that file in notepad , modify that file with your values and then again save it. and then run it. Second way is not efficient but it will get your work done later if you do this
在记事本中打开该文件,使用您的值修改该文件,然后再次保存它。然后运行它。第二种方法效率不高,但如果你这样做,它会在以后完成你的工作