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!!
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)
Please log in to answer
Posted by:
chrpai
20 years ago
Posted by:
cdupuis
20 years ago
Posted by:
lldan
20 years ago
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
====================================
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
20 years ago
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
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.
so that the conversation will remain readable.