By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,750 Members | 1,367 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,750 IT Pros & Developers. It's quick & easy.

Need an Example Modifying Remote Registry

P: n/a
Hi:

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

Thanks much!
Charles
Jul 29 '08 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Charles,

Any example in the documentation will do. The only thing you have to do
differently is call the static OpenRemoteBaseKey to get the hive on the
remote system you want to work with, and proceed from there.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Charles" <Ch*****@discussions.microsoft.comwrote in message
news:66**********************************@microsof t.com...
Hi:

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

Thanks much!
Charles

Jul 30 '08 #2

P: n/a
I get, "Use the new keyword to create an object instance". And we I do use
new I get
"Microsoft.Win32.RegistryKey.OpenRemoteBaseKey(Mic rosoft.Win32.RegistryHive,
string) is a mathod but is used like a type".

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

RegistryKey Tb2Key =
RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMa chine,
textBox4.Text).OpenSubKey("Software\\Netopia\\Timb uktu Pro\\TimbuktuName");
Tb2Key.SetValue("StringValue", textBox4.Text);

RegistryKey RoKey =
RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMa chine,
textBox4.Text).OpenSubKey("Software\\Microsoft\\Wi ndows
NT\\CurrentVersion\\RegisteredOwner");
RoKey.SetValue("StringValue", textBox3.Text);

RegistryKey CNameKey =
RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMa chine,
textBox4.Text).OpenSubKey("Software\\Microsoft\\Wi ndows
NT\\CurrentVersionRegisteredOrganization");
CNameKey.SetValue("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 OpenRemoteBaseKey to get the hive on the
remote system you want to work with, and proceed from there.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Charles" <Ch*****@discussions.microsoft.comwrote in message
news:66**********************************@microsof t.com...
Hi:

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

Thanks much!
Charles


Jul 30 '08 #3

P: n/a
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.OpenRemoteBaseKey(RegistryHive.LocalMa chine,
textBox4.Text).OpenSubKey("Software").OpenSubKey(" Microsoft").OpenSubKey("Windows NT").OpenSubKey("CurrentVersion");

CNameKey.SetValue("RegisteredOrganization", "Company Inc",
RegistryValueKind.String);

Thanks!
"Charles" wrote:
I get, "Use the new keyword to create an object instance". And we I do use
new I get
"Microsoft.Win32.RegistryKey.OpenRemoteBaseKey(Mic rosoft.Win32.RegistryHive,
string) is a mathod but is used like a type".

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

RegistryKey Tb2Key =
RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMa chine,
textBox4.Text).OpenSubKey("Software\\Netopia\\Timb uktu Pro\\TimbuktuName");
Tb2Key.SetValue("StringValue", textBox4.Text);

RegistryKey RoKey =
RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMa chine,
textBox4.Text).OpenSubKey("Software\\Microsoft\\Wi ndows
NT\\CurrentVersion\\RegisteredOwner");
RoKey.SetValue("StringValue", textBox3.Text);

RegistryKey CNameKey =
RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMa chine,
textBox4.Text).OpenSubKey("Software\\Microsoft\\Wi ndows
NT\\CurrentVersionRegisteredOrganization");
CNameKey.SetValue("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 OpenRemoteBaseKey to get the hive on the
remote system you want to work with, and proceed from there.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Charles" <Ch*****@discussions.microsoft.comwrote in message
news:66**********************************@microsof t.com...
Hi:
>
I'm looking for an example of modifying the registry of a remote system.
>
Thanks much!
Charles
Jul 30 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.