I am making an applications that works for multiple users and use data from registry that is written by another user.
currently I am writing to HKCU. and it is not working because HKCU is local. and after it failed i tried to write on Local Machine but it has some permision issues.
So what is the suitable location to write the registry in this scenario.
I am using following code to create to key.
RegistryKey regKey = Registry.CurrentUser;
RegistryKey subKey = regKey.CreateSubKey(subKeyName);
I read a lot about window registry and came to know that
HKEY_CURRENT_CONFIGwill besuitable in my case because
It is common location to all user.
Only problem with this Registry location is that u need Administrator rights to modify the key.
RegistryKey regKey = Registry.CurrentConfig;RegistryKey subKey = regKey.CreateSubKey(subKeyName);