Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

vb registry

Posted on 1998-12-30
4
Medium Priority
?
714 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
[X]
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
  • 2
4 Comments
 

Author Comment

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

Accepted Solution

by:
Mirkwood earned 300 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

688 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