Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
    
What do you think will happen when you log in after your user registry hive was replaced? –  Oliver Salzburg Feb 9 '12 at 17:34
    
Can't you just set the key/value that the program wants in your current HKCU? –  shf301 Feb 9 '12 at 17:53

2 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.

share|improve this answer

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).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.