-
Dec 6th, 2019, 12:07 PM
#1
Thread Starter
New Member
Registry call returns nothing
I cannot seem to access the values under the registry key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication
Dim readValue = My.Computer.Registry.GetValue(
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LockScreenContent", "manager", Nothing)
If My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authenti cation\LockScreenContent",
"manager", Nothing) Is Nothing Then
MsgBox("Value does not exist.")
else
MsgBox("The value is " & readValue)
End If
The value should be {A9B005E5-AB63-4C1D-AE9E-AA120A50BB0F} as shown in my regedit
Every entry below Authorization also returns nothing...
Any ideas?
-
Dec 6th, 2019, 12:48 PM
#2
Re: Registry call returns nothing
To access HKEY_LOCAL_MACHINE you need to use
Registry.LocalMachine.GetValue. If you change your calls to use that it should work. Also, you have a space in "authentication" in your if statement.
https://docs.microsoft.com/en-us/dot...tframework-4.8
-
Dec 6th, 2019, 01:01 PM
#3
Thread Starter
New Member
Re: Registry call returns nothing
Originally Posted by kfcSmitty
space is copy error (senior moment}
I changed the 2 lines to:
Dim readValue = My.Computer.Registry.LocalMachine.GetValue(
and
If My.Computer.Registry.LocalMachine.GetValue(...
and it returned "manager" not the value of it.
-
Dec 6th, 2019, 01:29 PM
#4
Re: Registry call returns nothing
Looks like you need to specify that you're in a 64 bit environment.
vb.net Code:
Using hklm = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64) Using key = hklm.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LockScreenContent", False) Dim keyValue As String = key.GetValue("manager", Nothing) Console.ReadLine() End Using End Using
-
Dec 6th, 2019, 01:50 PM
#5
Thread Starter
New Member
Re: Registry call returns nothing
Originally Posted by kfcSmitty
Looks like you need to specify that you're in a 64 bit environment.
vb.net Code:
Using hklm = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64) Using key = hklm.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LockScreenContent", False) Dim keyValue As String = key.GetValue("manager", Nothing) Console.ReadLine() End Using End Using
Must be something else missing.
I'm getting errors:
RegistryView, RegistryKey, and ReistryHive are not declared. It may be inaccessible due to its protection level.
-
Dec 6th, 2019, 01:53 PM
#6
Re: Registry call returns nothing
You need to import Microsoft.Win32
-
Jul 15th, 2020, 05:15 AM
#7
Re: Registry call returns nothing
@jvallee: https://github.com/PeterSwinkels/Registry-Editor - Does this project contain anything of use to you?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|