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
Printable View
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
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.
Joacim help. Could you mail me details of this function. Possibly a working example.
First of all read John's excellent article on how to access the Registry using API functions.
Then declare the RegConnectRegistry function like this:
The lpMachineName argument is the name of the computer you want to access. It must be in UNC notation ("\\ComputerName").Code:Public Declare Function RegConnectRegistry _
Lib "advapi32.dll" Alias "RegConnectRegistryA" ( _
ByVal lpMachineName As String, _
ByVal hKey As Long, _
phkResult As Long) As Long
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!