Hi,
I want to make a new key under HKEY_USERS.
I use RegCreateKeyEx(HKEY_USERS, "Test\\SOFTWARE", 0, NULL,
REG_OPTION_NON_VOLATILE,
KEY_ALL_ACCESS, NULL, &hKey, &dw);

However the function always returns - "The parameter is incorrect." . If I
change HKEY_USERS to HKEY_CURRENT_USER the key gets created. I can not add a
new key under HKEY_USERS even when I use Regedit.exe . I am testing on a
Windows XP professional PC . Can anyone tell me what is wrong?

Thanks!

Re: Cannot create a key uder HKEY_USERS ! by Frank

Frank
Mon Dec 15 03:40:19 CST 2003

HKEY_USERS is restricted to Admins and the OS. I'm betting you do not have
sufficient privileges to create a key there.

HTH
--
============
Frank Hickman
NobleSoft, Inc.
============
Replace the _nosp@m_ with @ to reply.


"Drago" <dragomirg@abv.bg> wrote in message
news:uAexszuwDHA.1576@TK2MSFTNGP11.phx.gbl...
> Hi,
> I want to make a new key under HKEY_USERS.
> I use RegCreateKeyEx(HKEY_USERS, "Test\\SOFTWARE", 0, NULL,
> REG_OPTION_NON_VOLATILE,
> KEY_ALL_ACCESS, NULL, &hKey, &dw);
>
> However the function always returns - "The parameter is incorrect." . If I
> change HKEY_USERS to HKEY_CURRENT_USER the key gets created. I can not add
a
> new key under HKEY_USERS even when I use Regedit.exe . I am testing on a
> Windows XP professional PC . Can anyone tell me what is wrong?
>
> Thanks!
>
>



Re: Cannot create a key uder HKEY_USERS ! by Drago

Drago
Mon Dec 15 03:58:07 CST 2003

Thanks for your reply but I am a computer administrator on the PC.


"Frank Hickman" <fhickman_nosp@m_noblesoft.com> wrote in message
news:d9ydnS3DIKQeHECiRVn-jA@comcast.com...
> HKEY_USERS is restricted to Admins and the OS. I'm betting you do not
have
> sufficient privileges to create a key there.
>
> HTH
> --
> ============
> Frank Hickman
> NobleSoft, Inc.
> ============
> Replace the _nosp@m_ with @ to reply.
>
>
> "Drago" <dragomirg@abv.bg> wrote in message
> news:uAexszuwDHA.1576@TK2MSFTNGP11.phx.gbl...
> > Hi,
> > I want to make a new key under HKEY_USERS.
> > I use RegCreateKeyEx(HKEY_USERS, "Test\\SOFTWARE", 0, NULL,
> > REG_OPTION_NON_VOLATILE,
> > KEY_ALL_ACCESS, NULL, &hKey, &dw);
> >
> > However the function always returns - "The parameter is incorrect." . If
I
> > change HKEY_USERS to HKEY_CURRENT_USER the key gets created. I can not
add
> a
> > new key under HKEY_USERS even when I use Regedit.exe . I am testing on a
> > Windows XP professional PC . Can anyone tell me what is wrong?
> >
> > Thanks!
> >
> >
>
>



Re: Cannot create a key uder HKEY_USERS ! by Frank

Frank
Mon Dec 15 05:07:11 CST 2003

Yes I see what you mean. I also could not successfully create a key under
it with admin rights. Perhaps it is locked from the kernel that says no to
anyone but NT_AUTHORITY or SYSTEM. Probably so that someone couldn't bypass
the security in order to create users.

--
Frank

"Drago" <dragomirg@abv.bg> wrote in message
news:uXeBlKvwDHA.2136@TK2MSFTNGP10.phx.gbl...
> Thanks for your reply but I am a computer administrator on the PC.
>
>
> "Frank Hickman" <fhickman_nosp@m_noblesoft.com> wrote in message
> news:d9ydnS3DIKQeHECiRVn-jA@comcast.com...
> > HKEY_USERS is restricted to Admins and the OS. I'm betting you do not
> have
> > sufficient privileges to create a key there.
> >
> > HTH
> > --
> > ============
> > Frank Hickman
> > NobleSoft, Inc.
> > ============
> > Replace the _nosp@m_ with @ to reply.
> >
> >
> > "Drago" <dragomirg@abv.bg> wrote in message
> > news:uAexszuwDHA.1576@TK2MSFTNGP11.phx.gbl...
> > > Hi,
> > > I want to make a new key under HKEY_USERS.
> > > I use RegCreateKeyEx(HKEY_USERS, "Test\\SOFTWARE", 0, NULL,
> > > REG_OPTION_NON_VOLATILE,
> > > KEY_ALL_ACCESS, NULL, &hKey, &dw);
> > >
> > > However the function always returns - "The parameter is incorrect." .
If
> I
> > > change HKEY_USERS to HKEY_CURRENT_USER the key gets created. I can not
> add
> > a
> > > new key under HKEY_USERS even when I use Regedit.exe . I am testing on
a
> > > Windows XP professional PC . Can anyone tell me what is wrong?
> > >
> > > Thanks!
> > >
> > >
> >
> >
>
>



Re: Cannot create a key uder HKEY_USERS ! by Alexander

Alexander
Mon Dec 15 10:39:04 CST 2003

HKEY_USERS is not a key in which you can create subkeys.
It's a global root "key" under which you can mount registry hives (registry
files), by calling RegLoadKey, and only if you have SE_BACKUP_NAME
privilege.

The same is for HKEY_LOCAL_MACHINE.

HKU and HKLM can only hold hives as subkeys.

"Drago" <dragomirg@abv.bg> wrote in message
news:uAexszuwDHA.1576@TK2MSFTNGP11.phx.gbl...
> Hi,
> I want to make a new key under HKEY_USERS.
> I use RegCreateKeyEx(HKEY_USERS, "Test\\SOFTWARE", 0, NULL,
> REG_OPTION_NON_VOLATILE,
> KEY_ALL_ACCESS, NULL, &hKey, &dw);
>
> However the function always returns - "The parameter is incorrect." . If I
> change HKEY_USERS to HKEY_CURRENT_USER the key gets created. I can not add
a
> new key under HKEY_USERS even when I use Regedit.exe . I am testing on a
> Windows XP professional PC . Can anyone tell me what is wrong?
>
> Thanks!
>
>



Re: Cannot create a key uder HKEY_USERS ! by Alexander

Alexander
Mon Dec 15 10:40:30 CST 2003

From RegCreateKeyEx documentation:

"An application cannot create a key that is a direct child of HKEY_USERS or
HKEY_LOCAL_MACHINE."

"Drago" <dragomirg@abv.bg> wrote in message
news:uAexszuwDHA.1576@TK2MSFTNGP11.phx.gbl...
> Hi,
> I want to make a new key under HKEY_USERS.
> I use RegCreateKeyEx(HKEY_USERS, "Test\\SOFTWARE", 0, NULL,
> REG_OPTION_NON_VOLATILE,
> KEY_ALL_ACCESS, NULL, &hKey, &dw);
>
> However the function always returns - "The parameter is incorrect." . If I
> change HKEY_USERS to HKEY_CURRENT_USER the key gets created. I can not add
a
> new key under HKEY_USERS even when I use Regedit.exe . I am testing on a
> Windows XP professional PC . Can anyone tell me what is wrong?
>
> Thanks!
>
>



Re: Cannot create a key uder HKEY_USERS ! by Jase

Jase
Mon Dec 15 22:39:01 CST 2003

I think the "direct child" is the key phrase there. Just create your key
under HKEY_USERS/Software.

Jase

"Alexander Grigoriev" <alegr@earthlink.net> wrote in message
news:exdLqoywDHA.2316@TK2MSFTNGP10.phx.gbl...
> From RegCreateKeyEx documentation:
>
> "An application cannot create a key that is a direct child of HKEY_USERS
or
> HKEY_LOCAL_MACHINE."
>
> "Drago" <dragomirg@abv.bg> wrote in message
> news:uAexszuwDHA.1576@TK2MSFTNGP11.phx.gbl...
> > Hi,
> > I want to make a new key under HKEY_USERS.
> > I use RegCreateKeyEx(HKEY_USERS, "Test\\SOFTWARE", 0, NULL,
> > REG_OPTION_NON_VOLATILE,
> > KEY_ALL_ACCESS, NULL, &hKey, &dw);
> >
> > However the function always returns - "The parameter is incorrect." . If
I
> > change HKEY_USERS to HKEY_CURRENT_USER the key gets created. I can not
add
> a
> > new key under HKEY_USERS even when I use Regedit.exe . I am testing on a
> > Windows XP professional PC . Can anyone tell me what is wrong?
> >
> > Thanks!
> >
> >
>
>



Re: Cannot create a key uder HKEY_USERS ! by Igor

Igor
Tue Dec 16 08:31:32 CST 2003

"Jase" <jshelley@spamblock.enersol.com.au> wrote in message
news:3fde8c65$0$18749$afc38c87@news.optusnet.com.au...
> I think the "direct child" is the key phrase there. Just create your
key
> under HKEY_USERS/Software.

There is no subkey named "Software" under HKEY_USERS. Are you maybe
confusing it with HKEY_CURRENT_USER?
--
With best wishes,
Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken



Re: Cannot create a key uder HKEY_USERS ! by Jase

Jase
Thu Dec 18 17:59:38 CST 2003

There is on my system ;-) There are two keys under HKEY_USERS.
1. .DEFAULT
2. Software

Why do you want to put the key there anyway? Is there a special reason why
you can't use a subkey of HKEY_LOCAL_MACHINE?

Jase

"Igor Tandetnik" <itandetnik@mvps.org> wrote in message
news:uESDsH%23wDHA.1680@TK2MSFTNGP12.phx.gbl...
> "Jase" <jshelley@spamblock.enersol.com.au> wrote in message
> news:3fde8c65$0$18749$afc38c87@news.optusnet.com.au...
> > I think the "direct child" is the key phrase there. Just create your
> key
> > under HKEY_USERS/Software.
>
> There is no subkey named "Software" under HKEY_USERS. Are you maybe
> confusing it with HKEY_CURRENT_USER?
> --
> With best wishes,
> Igor Tandetnik
>
> "For every complex problem, there is a solution that is simple, neat,
> and wrong." H.L. Mencken
>
>



Re: Cannot create a key uder HKEY_USERS ! by r

r
Thu Dec 18 20:07:42 CST 2003

On Fri, 19 Dec 2003 10:59:38 +1100, "Jase"
<jshelley@spamblock.enersol.com.au> wrote:
>
>"Igor Tandetnik" <itandetnik@mvps.org> wrote in message
>news:uESDsH%23wDHA.1680@TK2MSFTNGP12.phx.gbl...
>> "Jase" <jshelley@spamblock.enersol.com.au> wrote in message
>> news:3fde8c65$0$18749$afc38c87@news.optusnet.com.au...
>> > I think the "direct child" is the key phrase there. Just create your
>> key
>> > under HKEY_USERS/Software.
>>
>> There is no subkey named "Software" under HKEY_USERS. Are you maybe
>> confusing it with HKEY_CURRENT_USER?
>> --

>There is on my system ;-) There are two keys under HKEY_USERS.
>1. .DEFAULT
>2. Software
>
>Why do you want to put the key there anyway? Is there a special reason why
>you can't use a subkey of HKEY_LOCAL_MACHINE?
>

Yes, if you want each user to have his/her own private settings. The
proper place is HKEY_CURRENT_USER. The other location, HKEY_USERS
has all the separate user information in it.


Re: Cannot create a key uder HKEY_USERS ! by Jase

Jase
Sun Dec 21 22:19:03 CST 2003

"r norman" <rsn_@_comcast.net> wrote in message
news:k7n4uvgrlg4eammuaabvsvp3vqulvivaq3@4ax.com...
> On Fri, 19 Dec 2003 10:59:38 +1100, "Jase"
> <jshelley@spamblock.enersol.com.au> wrote:
> >
> >"Igor Tandetnik" <itandetnik@mvps.org> wrote in message
> >news:uESDsH%23wDHA.1680@TK2MSFTNGP12.phx.gbl...
> >> "Jase" <jshelley@spamblock.enersol.com.au> wrote in message
> >> news:3fde8c65$0$18749$afc38c87@news.optusnet.com.au...
> >> > I think the "direct child" is the key phrase there. Just create your
> >> key
> >> > under HKEY_USERS/Software.
> >>
> >> There is no subkey named "Software" under HKEY_USERS. Are you maybe
> >> confusing it with HKEY_CURRENT_USER?
> >> --
>
> >There is on my system ;-) There are two keys under HKEY_USERS.
> >1. .DEFAULT
> >2. Software
> >
> >Why do you want to put the key there anyway? Is there a special reason
why
> >you can't use a subkey of HKEY_LOCAL_MACHINE?
> >
>
> Yes, if you want each user to have his/her own private settings. The
> proper place is HKEY_CURRENT_USER. The other location, HKEY_USERS
> has all the separate user information in it.
>

Still confused. Why can't you use HKEY_LOCAL_MACHINE for common settings,
and HKEY_CURRENT_USER for user specific stuff?

Jase



Re: Cannot create a key uder HKEY_USERS ! by r

r
Sun Dec 21 22:39:43 CST 2003

On Mon, 22 Dec 2003 15:19:03 +1100, "Jase"
<jshelley@spamblock.enersol.com.au> wrote:

>"r norman" <rsn_@_comcast.net> wrote in message
>news:k7n4uvgrlg4eammuaabvsvp3vqulvivaq3@4ax.com...
>> On Fri, 19 Dec 2003 10:59:38 +1100, "Jase"
>> <jshelley@spamblock.enersol.com.au> wrote:
>> >
>> >"Igor Tandetnik" <itandetnik@mvps.org> wrote in message
>> >news:uESDsH%23wDHA.1680@TK2MSFTNGP12.phx.gbl...
>> >> "Jase" <jshelley@spamblock.enersol.com.au> wrote in message
>> >> news:3fde8c65$0$18749$afc38c87@news.optusnet.com.au...
>> >> > I think the "direct child" is the key phrase there. Just create your
>> >> key
>> >> > under HKEY_USERS/Software.
>> >>
>> >> There is no subkey named "Software" under HKEY_USERS. Are you maybe
>> >> confusing it with HKEY_CURRENT_USER?
>> >> --
>>
>> >There is on my system ;-) There are two keys under HKEY_USERS.
>> >1. .DEFAULT
>> >2. Software
>> >
>> >Why do you want to put the key there anyway? Is there a special reason
>why
>> >you can't use a subkey of HKEY_LOCAL_MACHINE?
>> >
>>
>> Yes, if you want each user to have his/her own private settings. The
>> proper place is HKEY_CURRENT_USER. The other location, HKEY_USERS
>> has all the separate user information in it.
>>
>
>Still confused. Why can't you use HKEY_LOCAL_MACHINE for common settings,
>and HKEY_CURRENT_USER for user specific stuff?
>
That is exactly what I was trying to say.

The reason you can't use a subkey of HKEY_LOCAL_MACHINE is
specifically to give users their own separate information. If you
want all users to share the information, then HKEY_LOCAL__MACHINE is
the place.


Re: Cannot create a key uder HKEY_USERS ! by Ron

Ron
Mon Dec 22 08:14:10 CST 2003


"Jase" <jshelley@spamblock.enersol.com.au> wrote in message news:3fe670b8$0$18689$afc38c87@news.optusnet.com.au...
> >
> > Yes, if you want each user to have his/her own private settings. The
> > proper place is HKEY_CURRENT_USER. The other location, HKEY_USERS
> > has all the separate user information in it.
> >
>
> Still confused. Why can't you use HKEY_LOCAL_MACHINE for common settings,
> and HKEY_CURRENT_USER for user specific stuff?
>

And HKEY_USERS is essentially just a list of the known users (one of which is going to
be mapped to HKEY_CURRENT_USER at any given time).


Re: Cannot create a key uder HKEY_USERS ! by Alexander

Alexander
Mon Dec 22 09:34:28 CST 2003


"Ron Natalie" <ron@sensor.com> wrote in message
news:3fe6b4f7$0$421$9a6e19ea@news.newshosting.com...
>
>
> And HKEY_USERS is essentially just a list of the known users (one of which
is going to
> be mapped to HKEY_CURRENT_USER at any given time).
>

Only those currently logged on (at least on NT/2K/XP).