Hope this helps Yes, but. Keys have permissions. It's certainly possible for a particular key somewhere in the tree descending from HKLM to have it's permissions set so that anyone can create values/subkeys within it.
This might help you Update: I have figured out what the problem was with regards to accessing the various sub items, both Directories and Registries. It appears the ACL is applied ONLY to child items and not to the root item. The issue below is a question as to how to solve this problem:
How to create a key in Windows registry without admin permissions?
wish of those help Since it is not possible to bypass UAC and write product key to HKey_Local_Machine with UAC security level is set to high, now i am writing the product key information to HKey_CurrentUser in registry. Even if the UAC security level is set to high, we can read and write to HKey_CurrentUser using VBA & Win-API . But the drawback of this method is my application's product key needs to be written to HKey_CurrentUser for each of the login-accounts one at a time, if the application is required to run in all the login-accounts on given system. all for the help.
Restricted resource access when auto run EXE over HKEY_LOCAL_MACHINE registry key
hope this fix your issue Solution from @HansPassant : Always use full path names for files, c:\foo\bar\baz.txt. Just baz.txt will not work, the Environment.CurrentDirectory is not set where you hope it is. Use AppData, if necessary use Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) to know where your EXE was installed.
How to create registry key under Computer\HKEY_LOCAL_MACHINE\SOFTWARE\ from C#
Does that help 32-bit apps will default to the 32-bit view of the registry. If you want to direct your key accesses to the 64-bit views, you need to open the registry hives manually and not using the Registry class members.
using (var hklm = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64))
using (var key = hklm.CreateSubKey(@"SOFTWARE\FolderName", writable: true))
// do stuff with the key
if (key.GetValue("TestKey") == null)