What is the best way to deploy a HKCU registry change for anyone who logs onto the machine. Someone mentioned to me Active Setup...but I am not sure.
-
Active Setup is really the way to go: http://serverfault.com/questions/11253/best-way-to-add-hkcu-keys-and-values-for-all-existing-users-and-all-new-users – Stein Åsmul Sep 18 '09 at 11:06
-
The **best way** is actually to have your **application** deal with all **HKCU** and **userprofile** settings, and never write anything here with an installer. It is user data, it shouldn't be meddled with by anything other than the user once created. Copy once from per-machine templates, or write with the application's internal defaults. – Stein Åsmul Aug 17 '14 at 15:36
4 Answers
Are you using Active Directory? Then you can use a Group Policy to change / add / remove Registry Settings for every user which logs onto a machine in the domain.
If you cant use GPO maybe a shortcut to a script which sets the values in C:\Documents and Settings\All Users\Start Menu\Programs\Startup can help you.
- 1,118
- 1
- 7
- 11
-
How can one use a Group Policy to add/change/remove registry settings for every user which logs onto a machine in the domain? – Ian Boyd Aug 24 '10 at 15:04
-
Hi Ian You need to create a script (batch, vbs...) which will to the changed and include the script in the Logon - Scripts of the GPO (User Configuration -> Windows Settings -> Scripts) – grub Aug 30 '10 at 11:12
This depends on what kind of network you're running.
On a single machine (which seems may be your case) you can create a profile (non-administrator) and set everything up the way you want it there. Then log off, log on as an administrator, and copy that profile to the Default User profile. To copy, right click My Computer, and select properties. Go to the Advanced Tab, User Profiles > Settings... From there, click on the profile you configured, and select Copy To. Browse to your Documents and Settings Folder, and Select Default User. Overwrite anything there. When a new user logs in, the settings you just set up will be copied to their new profile.
As stated before, you can apply a Group Policy, which will affect users while they're logged on if you're running Active Directory. Group Policy goes a step further and enforces the rules you put in it (users can't change the settings you dictate here.)
If you have a small network, you can use a tool such as PSExec and remotely execute applications on a remote machine, including a batch file that has the registry settings in it. See http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx for more info. Also, if you edit the registry itself, instead of editing, HKCU, edit HKEY_USERS, and select the .Default subkey, and place the settings in there.
- 1,336
- 7
- 12
Registry settings can also be put in an MSI (which can be built using Visual Studio, WinInstall LE or some other MSI authoring tool) and deployed via a GPO. Also handy for offline folks or where you don't have AD as you can just give them the MSI.
- 8,937
- 1
- 22
- 36
-
1Hi. Also possible with NSIS (http://nsis.sourceforge.net/Main_Page) An OpenSource Tool/Language for creating Windows Installers. – grub Aug 07 '09 at 16:31
There are several options.
- In a single-machine or few-machine scenario, you can use regedit to load the default user registry hive and make the changes there. This is then copied to all new users. I like to leave the default user registry hive alone if I can, though, so I would suggest that you use one of the other alternatives.
- Use Group Policy to apply a registry key or value. This may be unreliable over a wide area network if you have not tweaked your Group Policy processing latency.
- Use a logon script. You can write a *.cmd script that uses the reg.exe command to make any change you want. Type "reg /?" at a command prompt to see the syntax.
I discourage setting up an existing user profile as desired and then copying it over the default user profile. The shell is a very complicated program, and this copying can have undesired effects. See "Configuring default settings for Windows image deployment" on The Deployment Guys blog for a good discussion of this. Instead, search for user interface text on the web to find where that interface stores its settings in the registry. If you run into one that no one has written about on the web, use Process Monitor to capture everything written into the registry as you change the setting in the user interface. Then you will have the data you need to write your script or define your Group Policy object.
- 3,947
- 4
- 21
- 36