Reading Remote Registry using VB.Net

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nilaangel78
    New Member
    • Sep 2008
    • 7

    Reading Remote Registry using VB.Net

    Hi All,

    I want read the below remote registry using VB.Net.

    "SOFTWARE\Micro soft\Windows\Cu rrentVersion\In staller\UserDat a\S-1-5-18\Products"

    Please anyone help me.

    Thanks

    Nila
  • iam_clint
    Recognized Expert Top Contributor
    • Jul 2006
    • 1207

    #2
    So I am assuming the remote pc would be a pc on your network?
    Read remote Registry
    Code:
    Dim MyReg As Microsoft.Win32.RegistryKey = Microsoft.Win32.RegistryKey.OpenRemoteBaseKey(Microsoft.Win32.RegistryHive.LocalMachine, "dcops2100") 
    
            Dim MyRegKey As Microsoft.Win32.RegistryKey 
            Dim MyVal as string
    
            MyRegKey = MyReg.OpenSubKey("Software\Microsoft\Windows NT\currentVersion") 
            MyVal = MyRegKey.GetValue("RegisteredOwner") 
            MyRegKey.Close() 
            TextBox1.Text = MyVal
    Write Remote Registry
    Code:
    Dim MyReg As Microsoft.Win32.RegistryKey = Microsoft.Win32.RegistryKey.OpenRemoteBaseKey(Microsoft.Win32.RegistryHive.LocalMachine, "dcops2100") 
    
            Dim MyRegKey As Microsoft.Win32.RegistryKey 
            Dim MyVal as string
    
            MyRegKey = MyReg.OpenSubKey("Software\Microsoft\Windows NT\currentVersion", True) 
            MyRegKey.SetValue("RegisteredOwner", "EinzutragenerWert") 
            MyRegKey.Close()

    Comment

    • nilaangel78
      New Member
      • Sep 2008
      • 7

      #3
      Read remote Registry

      Hi Clint,

      I want to read the values from the below remote registry path.

      "SOFTWARE\Micro soft\Windows\Cu rrentVersion\In stall er\UserData\S-1-5-18\Products"

      I am using VB.Net

      Thanks.
      Nila

      Comment

      • iam_clint
        Recognized Expert Top Contributor
        • Jul 2006
        • 1207

        #4
        I gave full examples of reading and writing to a remote registry.. I will not write the code to your exact needs.. you should be able to handle this

        Comment

        • nilaangel78
          New Member
          • Sep 2008
          • 7

          #5
          Read Remote Registry

          Hi Clint,

          Thanks for your idea.
          Actually i read the remote registry using the code which i have posted. But it is not reading the values from the path i need. It is also not giving any error. So i was confused with this.

          Thanks.
          Nila

          Comment

          • dondreak
            New Member
            • Aug 2016
            • 1

            #6
            Originally posted by iam_clint
            So I am assuming the remote pc would be a pc on your network?
            Read remote Registry
            Code:
            Dim MyReg As Microsoft.Win32.RegistryKey = Microsoft.Win32.RegistryKey.OpenRemoteBaseKey(Microsoft.Win32.RegistryHive.LocalMachine, "dcops2100") 
            
                    Dim MyRegKey As Microsoft.Win32.RegistryKey 
                    Dim MyVal as string
            
                    MyRegKey = MyReg.OpenSubKey("Software\Microsoft\Windows NT\currentVersion") 
                    MyVal = MyRegKey.GetValue("RegisteredOwner") 
                    MyRegKey.Close() 
                    TextBox1.Text = MyVal
            Write Remote Registry
            Code:
            Dim MyReg As Microsoft.Win32.RegistryKey = Microsoft.Win32.RegistryKey.OpenRemoteBaseKey(Microsoft.Win32.RegistryHive.LocalMachine, "dcops2100") 
            
                    Dim MyRegKey As Microsoft.Win32.RegistryKey 
                    Dim MyVal as string
            
                    MyRegKey = MyReg.OpenSubKey("Software\Microsoft\Windows NT\currentVersion", True) 
                    MyRegKey.SetValue("RegisteredOwner", "EinzutragenerWert") 
                    MyRegKey.Close()
            I know it's been many years since this was written but I want to reply any way since this still helps people today.

            Thank you for posting this, it resolved a problem I was having reading remote registry. I was able to complete my program which reads the Office version and creates desktop shortcuts. I use this on our terminal server to help customers without even needing to connect to their computer.

            Comment

            Working...