Read Write Remote Registry

Read remote registry:


Dim MyReg As Microsoft.Win32.RegistryKey = Microsoft.Win32.RegistryKey.OpenRemoteBaseKey(Microsoft.Win32.RegistryHive.LocalMachine, "dcops2100") 

        Dim MyRegKey As Microsoft.Win32.RegistryKey 
        Dim MyVal 

        MyRegKey = MyReg.OpenSubKey("Software\Microsoft\Windows NT\currentVersion") 
        MyVal = MyRegKey.GetValue("RegisteredOwner") 
        MyRegKey.Close() 
        TextBox1.Text = MyVal 

Write to remote registry:


Dim MyReg As Microsoft.Win32.RegistryKey = Microsoft.Win32.RegistryKey.OpenRemoteBaseKey(Microsoft.Win32.RegistryHive.LocalMachine, "dcops2100") 

        Dim MyRegKey As Microsoft.Win32.RegistryKey 
        Dim MyVal 

        MyRegKey = MyReg.OpenSubKey("Software\Microsoft\Windows NT\currentVersion", True) 
        MyRegKey.SetValue("RegisteredOwner", "EinzutragenerWert") 
        MyRegKey.Close()