WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Sample Code from Users

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Load Default Users HKEY_CURRENTUSER


Question:

I am looking to change a hkcu setting for all future users...and was hoping to load the hkcu section of the default user's registry using regloadhive...

But it doesn't look as if that is possible. Am I going about it wrong?

Answer:

Here is what I have done in the past:
; Performing Def User operations
DefProf = "C:\Documents and Settings\Default User\ntuser.dat"
ErrorMode(@OFF)
rs = RegLoadHive(@REGUSERS, "MyRegPath", DefProf)
ErrorMode(@CANCEL)
If rs != 1 
	Message("My Settings", StrCat("ERROR - Could not load hive", @CRLF, DefProf))
	Exit	
Endif

RegSetDword(@REGUSERS, "MyRegPath\Control Panel\Desktop[ForegroundLockTimeout]", 00)

RegUnloadHive(@REGUSERS, "MyRegPath")

Article ID:   W16670
File Created: 2005:02:18:12:21:50
Last Updated: 2005:02:18:12:21:50