为什么我无法在Windows注册表中的HKEY_USERS下创建子键? [英] Why I cannot create a sub key under HKEY_USERS in the Windows registry?

查看:372
本文介绍了为什么我无法在Windows注册表中的HKEY_USERS下创建子键?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我想在HKEYS_USERS注册表项下创建一个子项。但是当我在RegEditor中执行此操作时,我得到了"无法创建密钥"。错误信息。如果我以编程方式执行此操作,则会出现"不正确的参数"。错误。


我想知道为什么我不能在那里创建一个子键。我已经是机器的管理员了。




问候,David Shen

解决方案

< blockquote>

如果你考虑它就有意义。


HKLM和HKEY_USERS等关键词根是一种虚拟键,这些根键的所有直接子键都有各自的文件包含它们自己及其包含的密钥。


由于RegCreateSubEx()没有参数来指定要存储密钥的文件路径,因此注册表无法知道在哪里存储密钥存储它。


要"创建"在这两个地方的子项下,您需要调用
RegLoadKey()
API,它允许您指定注册表数据的存储位置。 (您在其他地方创建关键内容,然后调用

RegSaveKeyEx()
保存到以后加载的文件中)


Hi,

I want to create a subkey under the HKEYS_USERS registry key. But I when I do it in the RegEditor, got a "Cannot create key" error message. If I do it programmatically, I got an "Incorrect parameter" error.

I wonder why I cannot create a subkey there. I am already the Administrator of the machine.


Regards, David Shen

解决方案

It makes sense if you think about it.

Key roots such as HKLM and HKEY_USERS are kind of virtual keys, and all immediate subkeys of these root keys have their individual files containing themselves and the keys they contains.

Since RegCreateSubEx() do not have parameter for you to specify which file path you want to store the keys, the registry would not have idea on where to store it.

To "create" subkey under these two places you need to call RegLoadKey() API, which does allow you to specify where the registry data would be stored. (You create the key content elsewhere, then call RegSaveKeyEx() to save to file to be loaded later)


这篇关于为什么我无法在Windows注册表中的HKEY_USERS下创建子键?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆