Solved

vb registry

Posted on 1998-12-30
4
677 Views
Last Modified: 2012-08-14
i won't to use the RegConnectRegistry function to remote a registry in another computer in a NT network . How i can do that?
THANKS
0
Comment
Question by:amhmood
  • 2
4 Comments
 

Author Comment

by:amhmood
ID: 1453195
Edited text of question
0
 
LVL 13

Accepted Solution

by:
Mirkwood earned 150 total points
ID: 1453196
First make sure that you have enough rights to do that.
See here documentation


RegConnectRegistry
The RegConnectRegistry function establishes a connection to a predefined registry handle on another computer.

LONG RegConnectRegistry(
  LPTSTR lpMachineName,
                    // address of name of remote computer
  HKEY hKey,        // predefined registry handle
  PHKEY phkResult   // address of buffer for remote registry handle
);
 
Parameters
lpMachineName
Pointer to a null-terminated string containing the name of the remote computer. The string has the following form:
\\computername

If lpMachineName is NULL, the local computer name is used.

hKey
Specifies the one of the following predefined registry handles on the remote computer.
HKEY_LOCAL_MACHINE
HKEY_USERS
Windows NT: HKEY_PERFORMANCE_DATA, if the remote computer is running Windows NT
Windows 95 and Windows 98: HKEY_DYN_DATA, if the remote computer is running Windows 95 or Windows 98
Windows 95 and Windows 98: HKEY_CURRENT_CONFIG, if the remote computer is running Windows 95 or Windows 98

You cannot specify the HKEY_CLASSES_ROOT or HKEY_CURRENT_USER value for this parameter.

phkResult
Pointer to a variable that receives a key handle identifying the predefined handle on the remote computer.
Return Values
If the function succeeds, the return value is ERROR_SUCCESS.

If the function fails, the return value is a nonzero error code defined in WINERROR.H. You can use the FormatMessage function with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a generic description of the error.

Remarks
When a handle returned by RegConnectRegistry is no longer needed, it should be closed by calling RegCloseKey.

QuickInfo
0
 
LVL 18

Expert Comment

by:mdougan
ID: 1453197
I have a sample at home that I'll have to send you later.  

MD
0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1453198
Private Const HKEY_LOCAL_MACHINE = &H80000002
Private Declare Function RegConnectRegistry Lib "advapi32.dll" Alias "RegConnectRegistryA" (ByVal lpMachineName As String, ByVal hKey As Long, phkResult As Long) As Long

Dim hKeym as long
RegConnectRegistry ("\\machine", HKEY_LOCAL_MACHINE, hkeyM)

0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now