Click here to Skip to main content
15,868,141 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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

1 solution

Are you running an app compiled for x86 on a 64-bit machine??
 
Share this answer
 
Comments
Adam R Harris 18-Jan-13 13:26pm    
Good question, that stupid WOW64 node has screwed me in the past.
Fred Andres 18-Jan-13 15:01pm    
Yes I am. What should I be doing?
Fred Andres 18-Jan-13 15:30pm    
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
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900