Click here to Skip to main content
Sign Up to vote bad
good
I am programming with Visual Basic in Visual Studio 2010. The following code returns null for rk
        Dim SoftwareKey As String
        Dim rk As RegistryKey
        SoftwareKey = "SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products"
        rk = Registry.LocalMachine.OpenSubKey(SoftwareKey)
 
However, I know that the sub key exists because I can see it when I run regedit.exe, the registry editor. What am I doing wrong?
Posted 18 Jan '13 - 6:47


1 solution

Are you running an app compiled for x86 on a 64-bit machine??
  Permalink  
Comments
Adam R Harris - 18 Jan '13 - 13:26
Good question, that stupid WOW64 node has screwed me in the past.
Fred Andres - 18 Jan '13 - 15:01
Yes I am. What should I be doing?
Fred Andres - 18 Jan '13 - 15:30
I changed it to x64 and it worked. Thanks so much.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Rohan Leuva 220
1 Sergey Alexandrovich Kryukov 208
2 OriginalGriff 208
3 Abhinav S 168
4 Mahesh Bailwal 165
0 Sergey Alexandrovich Kryukov 8,474
1 OriginalGriff 6,714
2 CPallini 3,603
3 Rohan Leuva 2,853
4 Maciej Los 2,234


Advertise | Privacy | Mobile
Web04 | 2.6.130516.1 | Last Updated 18 Jan 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid