Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
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 at 18-Jan-13 13:26pm
Good question, that stupid WOW64 node has screwed me in the past.
Fred Andres at 18-Jan-13 15:01pm
Yes I am. What should I be doing?
Fred Andres at 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
0 OriginalGriff 393
1 Sergey Alexandrovich Kryukov 232
2 Richard Deeming 180
3 Snehasish_Nandy 171
4 ChauhanAjay 170
0 Sergey Alexandrovich Kryukov 6,367
1 OriginalGriff 5,588
2 CPallini 2,473
3 Richard MacCutchan 1,627
4 Abhinav S 1,530

Advertise | Privacy | Mobile
Web04 | 2.8.140821.2 | Last Updated 18 Jan 2013
Copyright © CodeProject, 1999-2014
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