1

I am using this code to get a key from the registry:

RegistryKey mykey = 
      Registry.CurrentUser.OpenSubKey("Software\\Publisher\\Product", true);

And the key does exist in the registry under

\HKCU\Software\Publisher\Product

However, my code is compiled x86 and this is running on a x86_64 machine. So, I reckon I should create the key under

\HKCU\Software\WOW6432Node\Publisher\Product

however, the key isn't found. How can I change my registry (I cannot change the code) to find this key on a x86_64 machine?

Bart Friederichs
  • 33,050
  • 15
  • 95
  • 195
  • As far as I have understood your requirement, it would be good if you can create a service/code which would pull the details from the Regular Registry into the WOW6432Node. – Ram Mehta Feb 18 '14 at 13:35
  • @RamMehta infact, just doing it once manually would already help. Point is that I did that, but it doesn't seem to work. – Bart Friederichs Feb 18 '14 at 13:39
  • 2
    No, HKCU isn't redirected like that. HKLM is. You will have to look for another explanation. Like Product actually being a value instead of a key. – Hans Passant Feb 18 '14 at 13:40
  • So you mean to say the code is not picking up the value from the registry ? – Ram Mehta Feb 18 '14 at 14:06
  • @RamMehta yes, the little piece of C# code I provided returns `null`. – Bart Friederichs Feb 18 '14 at 14:08
  • I think you are missing something in the registry you created manually. As @HansPassant said, please give a detailed look one more time. – Ram Mehta Feb 18 '14 at 17:40

0 Answers0