I want to edit a specific value (type REG_SZ) in the registry for both x64 and x86, but the SetValue method will not change the value for x86. X64 works great. This is my code:
RegistryKey regKeySpecific = RegistryKey.OpenBaseKey(
RegistryHive.LocalMachine, RegistryView.Registry32);
RegistryKey registryKey = regKeySpecific.OpenSubKey(
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FolderDescriptions\\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}\\PropertyBag", true);
registryKey.SetValue("ThisPCPolicy", "Show", RegistryValueKind.String);
registryKey.Close();
I use the parameter RegistryView.Registry32in the first line of code to change the value in the x86 registry, but this does not work.
The problem has been identified but not resolved. This code always changes the key in the x64 registry (WOW6432Node):
"SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FolderDescriptions\\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}\\PropertyBag"
source
share