Registry read operation fails on Vista
-
Hi all. In my application I am trying to read some registry values which are stored during installation. Registry reading/writing operation works fine on all other OS but it fails on Vista. When I disable the UAC from Vista, it supports registry reading and writing. Here is the way I am disabling UAC Start->Control panel->User Accounts->Change Security Settings->Uncheck "Use User Account Control (UAC) to help protect your Computer”. But disabling UAC is certainly not a good way to get the solution. Is there any other way by which I can read/write registry without disabling UAC? Thanks
Sameer Thakur
-
Hi all. In my application I am trying to read some registry values which are stored during installation. Registry reading/writing operation works fine on all other OS but it fails on Vista. When I disable the UAC from Vista, it supports registry reading and writing. Here is the way I am disabling UAC Start->Control panel->User Accounts->Change Security Settings->Uncheck "Use User Account Control (UAC) to help protect your Computer”. But disabling UAC is certainly not a good way to get the solution. Is there any other way by which I can read/write registry without disabling UAC? Thanks
Sameer Thakur
You can write to HKEY_CURRENT_USER in the registry. Alternatively you can create a manifest file and then allow your application to run under Admin privileges and this would allow you to write to the registry. There are also some more ways in which you can do this that you can look for yourself.
Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_
-
Hi all. In my application I am trying to read some registry values which are stored during installation. Registry reading/writing operation works fine on all other OS but it fails on Vista. When I disable the UAC from Vista, it supports registry reading and writing. Here is the way I am disabling UAC Start->Control panel->User Accounts->Change Security Settings->Uncheck "Use User Account Control (UAC) to help protect your Computer”. But disabling UAC is certainly not a good way to get the solution. Is there any other way by which I can read/write registry without disabling UAC? Thanks
Sameer Thakur
-
Hi all. In my application I am trying to read some registry values which are stored during installation. Registry reading/writing operation works fine on all other OS but it fails on Vista. When I disable the UAC from Vista, it supports registry reading and writing. Here is the way I am disabling UAC Start->Control panel->User Accounts->Change Security Settings->Uncheck "Use User Account Control (UAC) to help protect your Computer”. But disabling UAC is certainly not a good way to get the solution. Is there any other way by which I can read/write registry without disabling UAC? Thanks
Sameer Thakur
Check the permissions requested when opening the primary keys for reading. You might be using KEY_ALL_ACCESS when you should only request the privileges you need. Try using only KEY_QUERY_VALUE|KEY_READ instead and oyu will find it probably works as expected.