|
-
Sep 2nd, 2000, 05:39 AM
#1
Thread Starter
Addicted Member
Hi All
On Win95 machines only, how can I, once connected to another machine, run a .reg file and have the contents of the .reg file take place on the remote machine.
Thanx
-
Sep 2nd, 2000, 05:59 AM
#2
You can't! The reg file has to be opened on the computer which registry you want to add it to.
You can however use the RegConnectRegistry function to edit the registry on a remote computer.
On Win95 you can't, however, edit the HKEY_CLASSES_ROOT or HKEY_CURRENT_USER when using the RegConnectRegistry function.
-
Sep 2nd, 2000, 06:05 AM
#3
Thread Starter
Addicted Member
Joacim help. Could you mail me details of this function. Possibly a working example.
-
Sep 2nd, 2000, 06:42 AM
#4
First of all read John's excellent article on how to access the Registry using API functions.
Then declare the RegConnectRegistry function like this:
Code:
Public Declare Function RegConnectRegistry _
Lib "advapi32.dll" Alias "RegConnectRegistryA" ( _
ByVal lpMachineName As String, _
ByVal hKey As Long, _
phkResult As Long) As Long
The lpMachineName argument is the name of the computer you want to access. It must be in UNC notation ("\\ComputerName").
The hKey argument is the value of one of the HKEY_xxx (you find the values of these in John's article).
To the phkResult argument you pass a variable that you have declared as Long. If the function is successfull it will contain the handle to the remote registry.
You use this handle instead of the HKEY_xxx values when you call the RegOpenKey or RegOpenKeyEx functions.
Remember to always call RegCloseKey afterwards.
Good luck!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|