Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Modify a registry value for all user profiles

Status
Not open for further replies.

Taepes

Programmer
Oct 8, 2004
3
0
0
BE
Does anybody know how to modify a registry value for all user profiles on a Windows XP computer? I need to modify the profile of each user who has logged on the computer, the default user profile and the current user profile.

I’ve already written a script which modifies the profiles of each user who has logged on the computer and the default user profile (I scan the profiles folders, load the ntuser.dat hives, and then modify the registry value). But I still have a problem with the current user profile…

It’s not really a problem when the script which modifies the registry value is run locally (simply edit the HKEY_CURRENT_USER hive). But when this script is run remotely with the help of ‘psexec.exe’ and the process is run in the System account (‘-s’ parameter), the HKEY_CURRENT_USER hive is not available and/or does not refer to the real user logged on the computer (?).

I’ve already found a workaround which consists in putting a script in each user profiles. Then, this little script updates the registry value(s) at the logon time. But I’m not really happy with this solution because it does not modify the registry value when the main script is run. So I don’t get the feedback immediately… which is quite annoying when it’s done in the scope of an enterprise distribution.

Does anybody experienced such kind of problem and found a (better) solution?

Thanking you in advance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top