I\'m trying to write in HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run
from my C++ application like this:
HKEY key;
if (Reg
The problem is that your application is subject to UAC registry virtualization. Because you did not include a manifest in your application, the system drops into an XP (!) compatibility mode. When you write to restricted parts of the registry under HKLM, the system re-directs them to what is known as the virtual store under HKCU.
You should add a manifest to your application so that you are no longer virtualized. If you really do need to write to HKLM then you will need to specify the requireAdministrator
option in the manifest so that your application is executed with elevated rights.
Probably your next move is to take some time to read the documentation that I linked to above and be sure that you fully understand all the implications of UAC.