[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Visual basic 2005, how to write registry key on remote computer

Posted on 2006-05-16
6
Medium Priority
?
1,134 Views
Last Modified: 2012-05-05
Hi,

I want to write a registry key on a remote computer via a form. The form contains 2 textboxes with the values of the computer name and the value of the key that has to be written on the specific computer.

So if someone could help me with some code examples to write the remote computer's registry?
Thanks,
Corné
0
Comment
Question by:cschipper
  • 3
  • 2
5 Comments
 
LVL 8

Accepted Solution

by:
bman9111 earned 100 total points
ID: 16695763
0
 
LVL 2

Author Comment

by:cschipper
ID: 16697230
thnx for te reply, but thats a local key. I need tot change a key on a remote computer.

I tried this:
Microsoft.Win32.RegistryKey.OpenRemoteBaseKey(Microsoft.Win32.RegistryHive.LocalMachine, textbox1Value).SetValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters", "srvcomment", textbox2Value)

but then i get an error: {"The specified RegistryValueKind is an invalid value.
Parameter name: valueKind"}
0
 
LVL 8

Expert Comment

by:bman9111
ID: 16704892
first u have to make sure that remote registry service is started and then u need to have access to that pc....

if u do then u need to first connect to the pc like u would do in computer management if u right click on it...


did u do that....meaning have u tapped into a remote registry using xp first before trying vb.net

the other tthing is what are u trying to do...touch the registry remotely could cause severe damage...

0
 
LVL 2

Author Comment

by:cschipper
ID: 16706556
hi,

i have access to the registry remotely, i have opened regedit and i am able to connect to the remote pc.

i am aware of the risk of touching the registry, but it's just the specific key i want to change and i know waht it's doing.
0
 
LVL 2

Author Comment

by:cschipper
ID: 16940354
I've accepted the first answer, which was a good hint and close the question.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses
Course of the Month20 days, 12 hours left to enroll

865 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question