如何向多个注册表项添加相同的值

如何向多个注册表项添加相同的值

我有一个单一值,我想使用 .REG 文件将其添加到许多不同的键中,并且我只是想确保我当前的语法是正确的,然后才冒险在我的计算机上运行它。

[HKEY_CLASSES_ROOT\WMP11.AssocFile.MP4\shell\Enqueue\command]
[HKEY_CLASSES_ROOT\WMP11.AssocFile.m3u\shell\Enqueue\command]
[HKEY_CLASSES_ROOT\WMP11.AssocFile.MPEG\shell\Enqueue\command]
[HKEY_CLASSES_ROOT\WMP11.AssocFile.WAX\shell\Enqueue\command]
[HKEY_CLASSES_ROOT\WMP11.AssocFile.WMV\shell\Enqueue\command] 
"DelegateExecute"="{45597c98-80f6-4549-84ff-752cf55e2d29}"

这里,我想将一个名为 的键添加到列出的所有五个注册表项中command,该键的字符串值为"DelegateExecute"="{45597c98-80f6-4549-84ff-752cf55e2d29}"。上述语法可以做到这一点吗?

答案1

我认为您希望Windows Registry Editor Version 5.00在文件的第一行中添加.reg一行空白行,然后继续处理每个单独的HKEY_CLASSES_ROOT条目,然后紧接着"DelegateExecute"="{45597c98-80f6-4549-84ff-752cf55e2d29}"为每个条目单独添加一行。本质上,利用另一个空白行,然后是下一个HKEY_CLASSES_ROOT条目,并在后续行中单独添加"DelegateExecute"="{45597c98-80f6-4549-84ff-752cf55e2d29}"一行,等等。换句话说,如下所示:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\WMP11.AssocFile.MP4\shell\Enqueue\command]
"DelegateExecute"="{45597c98-80f6-4549-84ff-752cf55e2d29}"

[HKEY_CLASSES_ROOT\WMP11.AssocFile.m3u\shell\Enqueue\command]
"DelegateExecute"="{45597c98-80f6-4549-84ff-752cf55e2d29}"

[HKEY_CLASSES_ROOT\WMP11.AssocFile.MPEG\shell\Enqueue\command]
"DelegateExecute"="{45597c98-80f6-4549-84ff-752cf55e2d29}"

[HKEY_CLASSES_ROOT\WMP11.AssocFile.WAX\shell\Enqueue\command]
"DelegateExecute"="{45597c98-80f6-4549-84ff-752cf55e2d29}"

[HKEY_CLASSES_ROOT\WMP11.AssocFile.WMV\shell\Enqueue\command] 
"DelegateExecute"="{45597c98-80f6-4549-84ff-752cf55e2d29}"

与往常一样,在进行任何更改之前请备份注册表的相应区域!

相关内容