RegConnectRegistryA fails to work
-
Hi.... I have a problem while accessing the registry of another system connected in same network. I work on a windows XP professional machine.I have to access a key in the registry of the other machine.When i use the function 'RegConnectRegistryA ', it gives an error 'The system could not find the environment option that you entered'.I'm not able to understand what the problem is. Please do help me out. Thnx in advance. :)
-
Hi.... I have a problem while accessing the registry of another system connected in same network. I work on a windows XP professional machine.I have to access a key in the registry of the other machine.When i use the function 'RegConnectRegistryA ', it gives an error 'The system could not find the environment option that you entered'.I'm not able to understand what the problem is. Please do help me out. Thnx in advance. :)
I can think of a few reasons why this wouldn't work. There are no "try with this user/password" combination, so it will be using the current user. Do you have sufficient rights on the other machine? You can use LogonUser/ImpersonateLoggedOnUser to change the user you're using - but it's not for the faint hearted. Also from the documentation: Windows XP Pro: If the computer is joined to a workgroup and the "Force network logons using local accounts to authenticate as Guest" policy is enabled, the function fails. Note that this policy is enabled by default for a computer running Windows XP Professional that is joined to a workgroup. Lastly, is the machine name valid? You may also be able to use an IP address rather than a name (ie, "\\192,168.0.99"), in which case, can you ping it? Did you remember the \\ in front of the name? Good luck, Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...