Click here to Skip to main content
12,503,749 members (32,686 online)
Rate this:
Please Sign up or sign in to vote.
See more: VB VS2010 VB.NET
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:47am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Are you running an app compiled for x86 on a 64-bit machine??
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

Advertise | Privacy | Mobile
Web02 | 2.8.160919.1 | Last Updated 18 Jan 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100