Jump to content

Recommended Posts

Posted

This is driving me nuts... I'm developing an app that will need to access and edit registry keys on a remote system; which mostly works. I can create/edit/delete values, and create registry keys, but cannot delete keys. This is a domain environment, and all the necessary rights have been granted. I can use regedit from the box I am writing the code on to connect to the test machine's registry, and delete all the keys I want, so the problem has to be with my code. Does anything stand out to you guys?

 

Dim MyReg As Microsoft.Win32.RegistryKey = Microsoft.Win32.RegistryKey.OpenRemoteBaseKey(Microsoft.Win32.RegistryHive.LocalMachine, txtCompName.Text)

Dim regKey As Microsoft.Win32.RegistryKey

 

regKey = MyReg.OpenSubKey("Software\TightVNC", True)

regKey.DeleteSubKey("server")

 

Every time I run this portion of code, it bombs out with "The procedure number is out of range." It doesn't seem to matter if I call it from MyReg, or regKey. Any ideas guys?

  • 3 weeks later...
Posted

Remote registry access with .Net 4.0

 

RegistryKey.OpenRemoteBaseKey Method (RegistryHive, String) (Microsoft.Win32)

 

In order for a key to be opened remotely, both the server and client machines must be running the remote registry service, and have remote administration enabled.

 

There are also some links in the 2nd URL with ref to 32 bit and 64 bit platform versions of the registry which may be of use

 

Also do you not require elevated access rights using a domain admin account similar to how you would in WMI ?

 

                            Dim MyReg As Microsoft.Win32.RegistryKey =  Microsoft.Win32.RegistryKey.OpenRemoteBaseKey([b]Microsoft.Win32.RegistryHive.LocalMachine, txtCompName.Text[/b])

 

why have you got the microsoft.win32.registryhive.localmachine ?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...