Change hive loaded into HKCU?

-1

Does anyone know of a scriptable way to change what hive is loaded into HKCU? There is a particular program that I need to run on startup that checks values in HKCU. However, I do not want to create a separate account or have it use the builtin Administrator account.

Matt

Posted 2012-02-09T17:08:01.327

Reputation: 1

What do you think will happen when you log in after your user registry hive was replaced? – Der Hochstapler – 2012-02-09T17:34:56.130

Can't you just set the key/value that the program wants in your current HKCU? – shf301 – 2012-02-09T17:53:50.803

Answers

2

First things first.

The HKEY_CURRENT_USER (HKCU) is a copy of the HKEY_USERS (HKU) of the user actually logged in a Windows session...

You can't load in HKCU somethings different than the keys and values of HKU

E.G. HKEY_USERS\S-1-5-21-3681983559-1923665867-785417408-1007 If the user with this ID is actually logged the HKCU IS a copy of the first one (say a "virtual" copy)

If you modify a key in HKU this is reflected in HKCU.

climenole

Posted 2012-02-09T17:08:01.327

Reputation: 3 180

0

I don't think this is possible. And if it is, it's a bad idea.

Consider this.

HKCU\Software\Microsoft\Windows\Run\

defines an item that should be run when the user logs in. You load that into your primary profile. But that profile has no access rights to the element defined in the registry. So it must fail. Or worse, it runs and deletes something of your primary profile.

This is a single, obvious conflict that will happen if you attempt this. I am sure there would be hundreds.

I could come up with a couple more points why this is a horrible idea. I'm sure you're approaching your problem the wrong way (or I simply misunderstood you).

Der Hochstapler

Posted 2012-02-09T17:08:01.327

Reputation: 77 228