RegEdit: HKEY_CURRENT_USER\ vs. HKEY_USERS

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15655
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

RegEdit: HKEY_CURRENT_USER\ vs. HKEY_USERS

Post by ChrisGreaves »

In my registry (RegEdit.exe) I see an entry:-

Code: Select all

HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Excel\Recent Files
I see another entry:-

Code: Select all

HKEY_USERS\S-1-5-21-1753586194-2408440837-989898595-1000\Software\Microsoft\Office\11.0\Excel\Recent Files
As far as I can tell, both keys have identical values (a set of FILEi showing files recently used in Excel2003).
Are these types of keys always twins of each other?
That is, if I were (in VBA) searching for stuff, could I focus my search only on the “HKEY_CURRENT_USER\” elements and safely ignore the “HKEY_USERS\S-1-5-21-1753586194-2408440837-989898595-1000” elements?
He who plants a seed, plants life.

User avatar
StuartR
Administrator
Posts: 12630
Joined: 16 Jan 2010, 15:49
Location: London, Europe

Re: RegEdit: HKEY_CURRENT_USER\ vs. HKEY_USERS

Post by StuartR »

I think that HKEY_CURRENT_USER always points to one of the entries in HKEY_USERS, depending on the ID of the logged in user
StuartR


User avatar
HansV
Administrator
Posts: 78642
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: RegEdit: HKEY_CURRENT_USER\ vs. HKEY_USERS

Post by HansV »

Yes - under HKEY_USERS, you'll find entries for each user, including the administrator account and "default" user. One of them will be for the one you login with, and that one is EXACTLY the same as HKEY_CURRENT_USER.

There are several such mirrored entries in the registry. Think of it as a SUBST.
Best wishes,
Hans

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15655
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: RegEdit: HKEY_CURRENT_USER\ vs. HKEY_USERS

Post by ChrisGreaves »

StuartR wrote:I think that HKEY_CURRENT_USER always points to one of the entries in HKEY_USERS, depending on the ID of the logged in user
Thanks Stuart (please see also my reply to Hans, once the Lounge has waited for a minute ...)
He who plants a seed, plants life.

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15655
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: RegEdit: HKEY_CURRENT_USER\ vs. HKEY_USERS

Post by ChrisGreaves »

HansV wrote:Yes - under HKEY_USERS, you'll find entries for each user, including the administrator account
Oh :scratch:
So say, just supposing, for arguments sake, I was writing a "most recently used" application.
I could include (to some extent) names of files that my co-workers were using?
Including {network drive}\my boss\performance review\Chris or similar?
Not that I could read the document, but I could find out when he/she started thinking about denying me a raise. Again.
Think of it as a SUBST.
You really know how to tug at my heart strings, don't you? :rofl:
He who plants a seed, plants life.

User avatar
HansV
Administrator
Posts: 78642
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: RegEdit: HKEY_CURRENT_USER\ vs. HKEY_USERS

Post by HansV »

Unless you're an administrator, you cannot write to the registry entries of other users.
Best wishes,
Hans

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15655
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: RegEdit: HKEY_CURRENT_USER\ vs. HKEY_USERS

Post by ChrisGreaves »

HansV wrote:Unless you're an administrator, you cannot write to the registry entries of other users.
Quite so.
But it seems that I would be able to read some data regarding the activities of other users?
He who plants a seed, plants life.

User avatar
HansV
Administrator
Posts: 78642
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: RegEdit: HKEY_CURRENT_USER\ vs. HKEY_USERS

Post by HansV »

I don't think so.
Best wishes,
Hans