So, you need to edit the HKCU, eh?

With a script? Well, that can be kind of difficult. Especially if you need to edit it for every user on the machine.

Working off of someone else’s script (see the head of the article I’m about to link), I created a script that will take care of logged in as well as logged out users’ HKCUs. Since I haven’t received permission from the original author to republish, I’m just linking the source, which includes a comment that I made with my modifications (5 posts down, under Ken Carlile)

As you can see, now that you’ve opened the link in another window, this script uses GOTOs. Quake in fear.

The main section looks for the logged in users, then tosses it over to modlikey for any it finds. That then does whatever you’re going to do on their user registry, which is globally accessible under HKU.

Then it searches through all the User folders (in C:\Users for WinVista and Win7, change the script to C:\Documents and Settings for XP–or use the dude’s script below mine that checks for OS!).

It then loads their ntuser.dat (ever wonder what that file was? Now you know!) in a temporary hive, at which point you can do whatever you want to it, then unloads it and goes back parses through the rest of them.

This script has worked wonders for me, especially in setting up
an extremely complicated install from Landesk with a TON of custom registry settings.