Coding Thread, VB .Net 2010 Remote Registry Access in Coding and Web Development; This is driving me nuts... I'm developing an app that will need to access and edit registry keys on a ...
-
14th March 2011, 01:30 PM #1 VB .Net 2010 Remote Registry Access
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(Micr osoft.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?
-
-
IDG Tech News
-
5th April 2011, 04:36 AM #2
- Rep Power
- 0
Did anyone have a solution for this? I am having the same problem.
-
-
5th April 2011, 08:05 AM #3 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 ?
Code:
Dim MyReg As Microsoft.Win32.RegistryKey = Microsoft.Win32.RegistryKey.OpenRemoteBaseKey(Microsoft.Win32.RegistryHive.LocalMachine, txtCompName.Text)
why have you got the microsoft.win32.registryhive.localmachine ?
-
SHARE: 
Similar Threads
-
By ICT_GUY in forum Windows Server 2008
Replies: 4
Last Post: 9th February 2011, 02:22 PM
-
Replies: 1
Last Post: 23rd October 2009, 08:53 AM
-
By link470 in forum Windows
Replies: 3
Last Post: 4th September 2009, 09:08 PM
-
By albertwt in forum Windows Server 2000/2003
Replies: 20
Last Post: 20th August 2009, 09:40 PM
-
By Michael in forum Windows
Replies: 9
Last Post: 12th March 2008, 12:09 PM
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules