Vicki05
-
Total Posts
:
8
- Scores: 0
-
Reward points
:
0
- Joined: 1/15/2012
-
Status: offline
|
Need Help loading registry hives of 2 user accounts
Sunday, January 15, 2012 6:54 AM
( permalink)
Hi All, I am new at scripting. I need to capture registry settings from 2 different user accounts. I need to load it in to the registry while being logged in as a Administrator. I need to load the registry hive of both users and get a specific registry settings and write to a text file. I need to do this via vbscript. Can someone please help or point me in the right direction. Thanks, Vicki
|
|
|
|
59cobalt
-
Total Posts
:
976
- Scores: 91
-
Reward points
:
0
- Joined: 7/17/2011
-
Status: online
|
Re:Need Help loading registry hives of 2 user accounts
Sunday, January 15, 2012 11:37 AM
( permalink)
|
|
|
|
Wakawaka
-
Total Posts
:
456
- Scores: 23
-
Reward points
:
0
- Joined: 8/27/2009
-
Status: offline
|
Re:Need Help loading registry hives of 2 user accounts
Sunday, January 15, 2012 2:55 PM
( permalink)
Can you provide more information? The registry info you are getting from the users, is it always users that have logged into the computer or are there just file you need to load when you use the administrator account? Normally, the active user is loading in the the HKEY_CURRENT_USER, which is a copy of the data found in HKEY_USERS making is hard to get specific user information as the HKEY_USERS key is based on a users SID. Good new is you can get the user's SID from the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\ key and match to a user profile. Of course, if the information is always static, I suppose you could just get the user SID and use it as a constant.
|
|
|
|
Vicki05
-
Total Posts
:
8
- Scores: 0
-
Reward points
:
0
- Joined: 1/15/2012
-
Status: offline
|
Re:Need Help loading registry hives of 2 user accounts
Sunday, January 15, 2012 4:34 PM
( permalink)
I need to be logged in as administrator before doing a backup of the system. I need to note down the 2 local user account setting in the registry. The only way to retrieve the setting is by loading the hive and getting the settings, writing to a text file and then unloading it. I need to do all this using vbscript. Any help in appreciated.
|
|
|
|
59cobalt
-
Total Posts
:
976
- Scores: 91
-
Reward points
:
0
- Joined: 7/17/2011
-
Status: online
|
Re:Need Help loading registry hives of 2 user accounts
Sunday, January 15, 2012 8:56 PM
( permalink)
VBScript doesn't support loading/unloading registry hives, so you need to resort to reg.exe for this task. Execute the command via the Run() method: hive = "C:\PATH\TO\ntuser.dat"
Set sh = CreateObject("WScript.Shell")
sh.Run "%COMSPEC% /c reg load HKU\TempHive " & Chr(34) & hive & Chr(34), 0, True
' do stuff
sh.Run "%COMSPEC% /c reg unload HKU\TempHive", 0, True
|
|
|
|
Vicki05
-
Total Posts
:
8
- Scores: 0
-
Reward points
:
0
- Joined: 1/15/2012
-
Status: offline
|
Re:Need Help loading registry hives of 2 user accounts
Monday, January 16, 2012 5:23 PM
( permalink)
Thanks a lot for your help. I had to do a little bit of modification but it worked and I was able to accomplish what I needs. Vicki
|
|
|
|
59cobalt
-
Total Posts
:
976
- Scores: 91
-
Reward points
:
0
- Joined: 7/17/2011
-
Status: online
|
Re:Need Help loading registry hives of 2 user accounts
Tuesday, January 17, 2012 9:50 AM
( permalink)
|
|
|
|
Vicki05
-
Total Posts
:
8
- Scores: 0
-
Reward points
:
0
- Joined: 1/15/2012
-
Status: offline
|
Re:Need Help loading registry hives of 2 user accounts
Wednesday, January 18, 2012 1:55 PM
( permalink)
I ran into a issue. With Windows XP, it loaded the registry hives fine and I was able to get the settings. When I tried in windows 2000 PC. It did not work. Any suggestions as to how I could do the same thing in Windows 2000? Thanks once again Vicki
|
|
|
|
59cobalt
-
Total Posts
:
976
- Scores: 91
-
Reward points
:
0
- Joined: 7/17/2011
-
Status: online
|
Re:Need Help loading registry hives of 2 user accounts
Wednesday, January 18, 2012 10:35 PM
( permalink)
On Windows 2000 you need to install the Support Tools from the Windows CD and add "%ProgramFiles%\Support Tools" to the %PATH%, IIRC. I'm not aware of a way to script loading/unloading of registry hives without reg.exe.
|
|
|
|
Vicki05
-
Total Posts
:
8
- Scores: 0
-
Reward points
:
0
- Joined: 1/15/2012
-
Status: offline
|
Re:Need Help loading registry hives of 2 user accounts
Thursday, January 19, 2012 6:16 AM
( permalink)
Hi 59cobalt, Your suggestion did resolve my issue. Thanks once again. Vicki
|
|
|
|
59cobalt
-
Total Posts
:
976
- Scores: 91
-
Reward points
:
0
- Joined: 7/17/2011
-
Status: online
|
Re:Need Help loading registry hives of 2 user accounts
Thursday, January 19, 2012 11:27 AM
( permalink)
|
|
|
|