Loading a registry hive in VBScript 
Author Message
 Loading a registry hive in VBScript

Does anybody know a way to load a registry hive in VBScript? I would like to
make changes to HKCU for an existing user who is not logged on. The only way
I would know to accomplish this would be to load the hive, make the changes
and unload the hive. All suggestions will be appreciated.


Tue, 06 Dec 2005 23:13:27 GMT  
 Loading a registry hive in VBScript


Quote:
> Does anybody know a way to load a registry hive in VBScript? I would
> like to make changes to HKCU for an existing user who is not logged
> on. The only way I would know to accomplish this would be to load the
> hive, make the changes and unload the hive. All suggestions will be
> appreciated.

1. You can shell to the "REG" utility provided in the NT or W2K resource
kits.

Quote:
> C:\> REG LOAD /?

> Registry Console Tool For Windows 2000 - version 2.0
> Copyright (C) Microsoft Corp. 1981-1999.  All rights reserved

> REG LOAD KeyName FileName

>   KeyName    [\\Machine\]FullKey
>     Machine  Name of remote machine - omitting defaults to the current
> machine
>              Only HKLM and HKU are available on remote machines
>     FullKey  ROOTKEY\SubKey
>     ROOTKEY  [ HKLM | HKU ]
>     SubKey   The key name to load the hive file into. Creating a new key
>   FileName   The name of the hive file to load
>              You must use REG SAVE to create this file

> Examples:

>   REG LOAD HKLM\TempHive TempHive.hiv
>     Loads the file TempHive.hiv to the Key HKLM\TempHive

>   REG LOAD \\ZODIAC\HKLM\TempHive Back.hiv
>     Loads the file Back.hiv on ZODIAC to the key HKLM\TempHive on ZODIAC

2. If you have the user's password available, you could spawn a task as
that user (using RunAs) to force the system to load the hive.

3. You could defer making the changes to when the user actually does log
in by applying them from a login script.

4. You could laboriously script "REGEDT32" using Sendkeys.  Ugh.

--
Ross Presser -- rpresser AT imtek DOT com
"... VB is essentially the modern equivalent of vulgar Latin in 13th
Centurary Europe. Understand it, and you can travel to places you never
heard of and still understand some people." -- Alex K. Angelopoulos



Tue, 06 Dec 2005 23:53:24 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Loading registry hives

2. Loading Registry Hives

3. Loading and Editing User Registry Hives

4. Loading registry hives

5. load registry hive to HKEY_LOCAL_MACHINE

6. Registry LoadKey to load hives?

7. Changing security settings on registry hives with vbscript

8. loading hive with wsh

9. Scan the entire Registry hive

10. Editing registry hive remotely

11. Registry hive location for current user.

12. saving and restoring Registry hive

 

 
Powered by phpBB® Forum Software