I need to modify a subkey of HKEY_CURRENT_USER for all profiles that on the computer my script executes on. Does anyone have a good method of doing this?
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

1
If you need to add a new value to the registry, then you could try writing to "HKEY_USERS\.DEFAULT\...". This appears to be the fallback place that windows looks if a value does not exist in HKEY_CURRENT_USER.

If you need to change an existing key then you can cycle through "HKEY_USERS\" to get to all the user hives that are currently loaded. Note that on W2K/WXP each user will have two hives - the extra one is the user specific HKEY_CLASSES_ROOT.

If you what to change an existing key for all profiles (even the ones not logged in), then you will have to load the user registry hives manually - but I will assume this isn't what you need to do.
Answered 02/05/2004 by: mrtap
Senior Yellow Belt

Please log in to comment
1
Aside from editing .default ( the all users registry ) you could have a reg file import with the logon script, thats how we import per user settings for accounts that already exist.
Answered 03/23/2004 by: Ap0kalipSe
Senior Yellow Belt

Please log in to comment
1
I would think that you don't need to worry about profiles which haven't logged in... if the profile will be used, it will log on eventually.

If the keys you need are for a specific application, just install that application as an MSI with the ALLUSERS property set to 1.

That way, when the app gets launched, even from a different profile, any missing components (including your reg keys) get self-repaired - i.e. placed in the registry of the currently logged in profile.
Answered 03/23/2004 by: sean_c_roberts
Senior Purple Belt

Please log in to comment
1
I've had some luck putting those entries in HKLM. They seem to automagically get transferred to HKCU when a user logs on if the HKCU needs it.
Answered 07/23/2004 by: rogebil
Senior Yellow Belt

Please log in to comment
1
try investigating active setup as well. its a great way to do things to each user without the requirement of complex scripting.
Answered 07/26/2004 by: jmcfadyen
Fifth Degree Black Belt

Please log in to comment
1
Ugh!

I have to respectfully disagree about using ActiveSetup.

It worked GREAT pre-MSI, but it's a pain to configure. Plus, you need a seperate exe with JUST your user-specific reg keys and files - this is what gets run when ActiveSetup sees a new profile login.

Just my opinion :)

P.S. When I was at Pfizer, we had a Wise template for ActiveSetup - if anyone wants a copy, lemme know and I'll see if I can dig it up.

Kind regards,

- Sean
Answered 08/02/2004 by: sean_c_roberts
Senior Purple Belt

Please log in to comment
Answer this question or Comment on this question for clarity