/build/static/layout/Breadcrumb_cap_w.png

VBScript to load hive not using REG.exe

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.

Environment:
Server 2003
Windows XP Sp1

Thanks all!!

0 Comments   [ + ] Show comments

Answers (4)

Posted by: chrpai 19 years ago
Senior Yellow Belt
0
I'm assuming you mean regedit.exe not reg.exe, and do you mean export/import or load/unload?
Posted by: cdupuis 19 years ago
Third Degree Green Belt
0
regedt32.exe has the ability to load and unload user hives for users who are not logged on.
Posted by: lldan 19 years ago
Senior Yellow Belt
0
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
Posted by: jaclaz 19 years ago
Yellow Belt
0
If it is not "compulsory" to be Visual Basic, you can try this little .exe:
Load Hive
that you can find here:
http://www.matcode.com/codes.htm
(size 7 kb)

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

jaclaz
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ