Link to home
Start Free TrialLog in
Avatar of chad
chad

asked on

Reading a registry value of a remote computer using vb.net 2005


I am using vb.net express 2005 and would like to access a registry key to a computer that is not running the application.  The remote computer may be on a different domain then the one I am working on.  I would have full admin rights to the remote domain/computer.

any ideas.

thanks
K
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

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 chad
chad

ASKER

thabks Bob,  I do not have ccess right now.  I'll check your code out later today
Pay close attention to the root key enums like RemoteLocalMachine--they require an additional 'machineName' argument (the methods have overloaded signatures).

Bob
Avatar of chad

ASKER

Thanks Bob.  I edited a bit to fit my needs but it works great.  One of these days I will learn more about using classes.
:-)

thanks




Dim keypath = "software\..."
        Dim machineName = "..."
        Dim KeyName = "(default)"
        Dim defaultValue = "unreadable"

        Dim rootKey As Win32.RegistryKey = Win32.RegistryKey.OpenRemoteBaseKey(Win32.RegistryHive.LocalMachine, machineName)
        Dim searchKey As Win32.RegistryKey = rootKey.OpenSubKey(keyPath)
        MessageBox.Show(searchKey.GetValue(KeyName, defaultValue))