Need Help loading registry hives of 2 user accounts

Author Message
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)
0
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
 
#1
    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)
    0
    reg load /?

     
    #2
      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)
      0
      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.
       
      #3
        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)
        0
        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.
         
         
        #4
          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)
          0
          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

           
          #5
            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)
            0
            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
             
            #6
              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)
              0
              You're welcome.
               
              #7
                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)
                0
                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
                 
                #8
                  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)
                  0
                  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.
                   
                  #9
                    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)
                    0
                    Hi 59cobalt,
                     
                    Your suggestion did resolve my issue.

                    Thanks once again.
                    Vicki
                     
                    #10
                      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)
                      0
                      You're welcome.
                       
                      #11

                        Online Bookmarks Sharing: Share/Bookmark

                        Jump to:

                        Current active users

                        There are 0 members and 1 guests.

                        Icon Legend and Permission

                        • New Messages
                        • No New Messages
                        • Hot Topic w/ New Messages
                        • Hot Topic w/o New Messages
                        • Locked w/ New Messages
                        • Locked w/o New Messages
                        • Read Message
                        • Post New Thread
                        • Reply to message
                        • Post New Poll
                        • Submit Vote
                        • Post reward post
                        • Delete my own posts
                        • Delete my own threads
                        • Rate post

                        2000-2012 ASPPlayground.NET Forum Version 3.9