Need an Example Modifying Remote Registry

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?Q2hhcmxlcw==?=

    Need an Example Modifying Remote Registry

    Hi:

    I'm looking for an example of modifying the registry of a remote system.

    Thanks much!
    Charles
  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: Need an Example Modifying Remote Registry

    Charles,

    Any example in the documentation will do. The only thing you have to do
    differently is call the static OpenRemoteBaseK ey to get the hive on the
    remote system you want to work with, and proceed from there.


    --
    - Nicholas Paldino [.NET/C# MVP]
    - mvp@spam.guard. caspershouse.co m

    "Charles" <Charles@discus sions.microsoft .comwrote in message
    news:66510017-C79B-43B9-AAD3-BA82D78B7541@mi crosoft.com...
    Hi:
    >
    I'm looking for an example of modifying the registry of a remote system.
    >
    Thanks much!
    Charles

    Comment

    • =?Utf-8?B?Q2hhcmxlcw==?=

      #3
      Re: Need an Example Modifying Remote Registry

      I get, "Use the new keyword to create an object instance". And we I do use
      new I get
      "Microsoft.Win3 2.RegistryKey.O penRemoteBaseKe y(Microsoft.Win 32.RegistryHive ,
      string) is a mathod but is used like a type".

      This is what I'm trying to get to work:

      RegistryKey Tb2Key =
      RegistryKey.Ope nRemoteBaseKey( RegistryHive.Lo calMachine,
      textBox4.Text). OpenSubKey("Sof tware\\Netopia\ \Timbuktu Pro\\TimbuktuNa me");
      Tb2Key.SetValue ("StringValu e", textBox4.Text);

      RegistryKey RoKey =
      RegistryKey.Ope nRemoteBaseKey( RegistryHive.Lo calMachine,
      textBox4.Text). OpenSubKey("Sof tware\\Microsof t\\Windows
      NT\\CurrentVers ion\\Registered Owner");
      RoKey.SetValue( "StringValu e", textBox3.Text);

      RegistryKey CNameKey =
      RegistryKey.Ope nRemoteBaseKey( RegistryHive.Lo calMachine,
      textBox4.Text). OpenSubKey("Sof tware\\Microsof t\\Windows
      NT\\CurrentVers ionRegisteredOr ganization");
      CNameKey.SetVal ue("StringValue ", "NeuStar Inc");

      Tb2Key.Close();
      RoKey.Close();
      CNameKey.Close( );

      "Nicholas Paldino [.NET/C# MVP]" wrote:
      Charles,
      >
      Any example in the documentation will do. The only thing you have to do
      differently is call the static OpenRemoteBaseK ey to get the hive on the
      remote system you want to work with, and proceed from there.
      >
      >
      --
      - Nicholas Paldino [.NET/C# MVP]
      - mvp@spam.guard. caspershouse.co m
      >
      "Charles" <Charles@discus sions.microsoft .comwrote in message
      news:66510017-C79B-43B9-AAD3-BA82D78B7541@mi crosoft.com...
      Hi:

      I'm looking for an example of modifying the registry of a remote system.

      Thanks much!
      Charles
      >
      >
      >

      Comment

      • =?Utf-8?B?Q2hhcmxlcw==?=

        #4
        Re: Need an Example Modifying Remote Registry

        I made a change and I think I'm close. It's now telling me that I don't have
        permissions to the remote system. The remote system is a virtual machine in
        my domain and I do have permissions as I am running the program as an admin
        of the domain.

        RegistryKey CNameKey =
        RegistryKey.Ope nRemoteBaseKey( RegistryHive.Lo calMachine,
        textBox4.Text). OpenSubKey("Sof tware").OpenSub Key("Microsoft" ).OpenSubKey("W indows NT").OpenSubKey ("CurrentVersio n");

        CNameKey.SetVal ue("RegisteredO rganization", "Company Inc",
        RegistryValueKi nd.String);

        Thanks!


        "Charles" wrote:
        I get, "Use the new keyword to create an object instance". And we I do use
        new I get
        "Microsoft.Win3 2.RegistryKey.O penRemoteBaseKe y(Microsoft.Win 32.RegistryHive ,
        string) is a mathod but is used like a type".
        >
        This is what I'm trying to get to work:
        >
        RegistryKey Tb2Key =
        RegistryKey.Ope nRemoteBaseKey( RegistryHive.Lo calMachine,
        textBox4.Text). OpenSubKey("Sof tware\\Netopia\ \Timbuktu Pro\\TimbuktuNa me");
        Tb2Key.SetValue ("StringValu e", textBox4.Text);
        >
        RegistryKey RoKey =
        RegistryKey.Ope nRemoteBaseKey( RegistryHive.Lo calMachine,
        textBox4.Text). OpenSubKey("Sof tware\\Microsof t\\Windows
        NT\\CurrentVers ion\\Registered Owner");
        RoKey.SetValue( "StringValu e", textBox3.Text);
        >
        RegistryKey CNameKey =
        RegistryKey.Ope nRemoteBaseKey( RegistryHive.Lo calMachine,
        textBox4.Text). OpenSubKey("Sof tware\\Microsof t\\Windows
        NT\\CurrentVers ionRegisteredOr ganization");
        CNameKey.SetVal ue("StringValue ", "NeuStar Inc");
        >
        Tb2Key.Close();
        RoKey.Close();
        CNameKey.Close( );
        >
        "Nicholas Paldino [.NET/C# MVP]" wrote:
        >
        Charles,

        Any example in the documentation will do. The only thing you have to do
        differently is call the static OpenRemoteBaseK ey to get the hive on the
        remote system you want to work with, and proceed from there.


        --
        - Nicholas Paldino [.NET/C# MVP]
        - mvp@spam.guard. caspershouse.co m

        "Charles" <Charles@discus sions.microsoft .comwrote in message
        news:66510017-C79B-43B9-AAD3-BA82D78B7541@mi crosoft.com...
        Hi:
        >
        I'm looking for an example of modifying the registry of a remote system.
        >
        Thanks much!
        Charles

        Comment

        Working...