Link to home
Start Free TrialLog in
Avatar of cschipper
cschipper

asked on

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

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é
ASKER CERTIFIED SOLUTION
Avatar of bman9111
bman9111

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cschipper
cschipper

ASKER

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"}
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...

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.
I've accepted the first answer, which was a good hint and close the question.