PDA

Click to See Complete Forum and Search --> : ACCESSING REGISTRY REMOTELY


dmain
Aug 21st, 2000, 11:48 AM
Does anybody know how to access the registry on a separate, remote machine through VB? I am writing a diagnostic program and need to be able to check the registry settings on several remote machines.

gfrench
Aug 24th, 2000, 05:17 PM
If you know how to use the standard registry API's already you will find this simple, else contact me and i will take you through registry api's.

The main difference is instead of opening the registry using regopenkey you use regconnectregistry.

here is the declare:

<---Start of API Declare--->
Declare Function RegConnectRegistry Lib "advapi32.dll" Alias "RegConnectRegistryA" (ByVal lpMachineName As String, ByVal hKey As Long, phkResult As Long) As Long
<---End of API Declare--->

phkresult is the key to the registry that you use in calls like regDeleteKey etc.

lpMachineName is the UNC of the remote machine ie. \\TRINITY

hKey is the registry root key you want to access, ie. HKEY_LOCAL_MACHINE.

hkey Constants

<---Start of constants--->
Public Const HKEY_CLASSES_ROOT = &H80000000
Public Const HKEY_CURRENT_CONFIG = &H80000005
Public Const HKEY_CURRENT_USER = &H80000001
Public Const HKEY_DYN_DATA = &H80000006
Public Const HKEY_LOCAL_MACHINE = &H80000002
Public Const HKEY_PERFORMANCE_DATA = &H80000004
Public Const HKEY_USERS = &H80000003
<---End of constants--->

Hope this has helped you


Grant French

E-Mail: grant.french@libertysurf.co.uk
ICQ: 33122184