I am trying to make changes in the windows 7 x64 registry. I already had code to change registry keys for 32bit systems and some of those also work on the 64 bit version. However some of them don't and i know it has something to do with the WOW64node, but i just can't get it to work.
Existing code:
regkey = My.Computer.Registry.CurrentUser.OpenSubKey("Control Panel\International", True)
regkey.SetValue("sDecimal", ",")
regkey.Close()
This works on windows 7 32bit bud not on 64bit. So I tried the following:
rk1 = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Registry64)
rk2 = rk1.OpenSubKey("Control Panel\International", True)
rk2.SetValue("sDecimal", ",")
regkey.Close()
This doesn't work and i guess it is because of not using WOW64node. However when I experiment with it in the code it doesn't run.
This piece of code does work on 64bit funny enough:
regkey = My.Computer.Registry.LocalMachine.OpenSubKey("Software\Microsoft\Windows NT\CurrentVersion\Winlogon", True)
regkey.SetValue("Shell", "C:\mmi_loader.exe", RegistryValueKind.String)
regkey.Close()
What am i doing wrong? It would be ideal if the code could be adapted in such a way that it would work on both 32bit and 64bit.
Thanks in advance,