Click here to Skip to main content
12,885,226 members (37,085 online)
Rate this:
Please Sign up or sign in to vote.
See more: VB VB.NET
Below is the code i have been using to get remote registry information from windows 7 seats that have a 64 bit os. My issue is were expanding our company and a group that we just got has windows xp seats which is fine they will get upgraded but in the mean time the have netframework 3.5 and with that i can declare the registry view and i need them to beable to read a windows 7 64 bit registry. If someone can help me improve my code to make it more universal to use from in operating system and or architecture(x86 or x64) that would be great.

Dim value
Dim localKey = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, strComputer, RegistryView.Registry64)
localKey = localKey.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI")
Dim value64 = localKey.GetValue("LastLoggedOnUser")
Dim localKey32 = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, strComputer, RegistryView.Registry32)
localKey32 = localKey32.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI")
Dim value32 = localKey32.GetValue("LastLoggedOnUser")
If value64 = Nothing Then
    value = value32
    value = value64
End If
Posted 15-Jun-12 6:17am
ledtech3 15-Jun-12 23:39pm
From the Code you posted, it Looks Like they are Getting the Exact same Registry key If it is 32 or 64 bit.
Are you trying to find out if the system you are trying to connect is 32 or 64 bit ? I have written programs for getting information from the registry that work on both 32 and 64 bit systems, but I have not done remote Registry. Is there something Different about remote than local ?

1 solution

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

Solution 1

Found in 60 seconds Googling for "read 64-bit registry from 32-bit process":[^]

...complete with examples.

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.170424.1 | Last Updated 15 Jun 2012
Copyright © CodeProject, 1999-2017
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