Hello everyone.

I'm in need of a vbscript that loads a registry hive and that does not use reg.exe. Has anyone created something like this? Even if reg.exe is in there I would still be interested. We are trying to run a vbscript as a machine based policy that loads/unloads a reg hive.

Server 2003
Windows XP Sp1

Thanks all!!
0 Comments   [ + ] Show 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.


I'm assuming you mean regedit.exe not reg.exe, and do you mean export/import or load/unload?
Answered 07/08/2004 by: chrpai
Senior Yellow Belt

Please log in to comment
regedt32.exe has the ability to load and unload user hives for users who are not logged on.
Answered 07/08/2004 by: cdupuis
Third Degree Green Belt

Please log in to comment
Below is the vbscript (function) we are trying to implement as a machine startup script using Group Policies. Any thoughts???


Function ModUserHive()
'Loads, Changes and Unloads Default User Hive to change preferred walpaper and background color
set objshell = CreateObject("Wscript.shell")
strComputer = "."
strKeyPath1 = "Tempdefault\Control Panel\Desktop"
strKeyPath2 = "Tempdefault\Control Panel\Colors"
objshell.Exec ("%comspec% /k reg.exe load HKU\Tempdefault c:\Docume~1\Defaul~1\ntuser.dat")
Set objReg = GetObject("winmgmts:" & _
"{impersonationLevel=Impersonate}!\\" & _
strComputer & "\root\default:StdRegProv")

objReg.SetStringValue HKEY_USERS,strKeyPath1,"Wallpaper","C:\WINDOWS\Web\Wallpaper\kiosk.bmp"
objReg.SetStringValue HKEY_USERS,strKeyPath1,"OriginalWallpaper","C:\WINDOWS\Web\Wallpaper\kiosk.bmp"
objReg.SetStringValue HKEY_USERS,strKeyPath2,"Background","26 98 4"

'objshell.Exec ("%comspec% /k reg.exe unload HKU\Tempdefault")
End Function
Answered 07/09/2004 by: lldan
Senior Yellow Belt

Please log in to comment
If it is not "compulsory" to be Visual Basic, you can try this little .exe:
Load Hive
that you can find here:
(size 7 kb)

With the above and this little nifty utility:
that you can find here:
(size 22 kb)
You can do almost anything to a poor innocent registry hive!

Answered 07/26/2004 by: jaclaz
Yellow Belt

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