Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

vb registry

Posted on 1998-12-30
4
692 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

839 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