I'm trying to insert some simple registry keys using Microsoft.Win32.RegistryKey in c# but the path automatically changes from:
HKEY_LOCAL_MACHINE\SOFTWARE\Test
to
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Test
I tried google but I only get some vague and confusing results. Has anyone dealt with this issue before? Some example code would be much appereciated.
You can use RegistryKey.OpenBaseKey to solve this problem:
var baseReg = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64);
var reg = baseReg.CreateSubKey("Software\\Test");