Jump to content

RegRead Issue


adbcode
 Share

Go to solution Solved by AoRaToS,

Recommended Posts

I tried to find a similar situation before posting but did not seem to find one. My issue is reading a key formatted like this: 

Local $sHive = "HKEY_LOCAL_MACHINE"
If @OSArch = "X64" Or @OSArch = "IA64" Then $sHive = "HKEY_LOCAL_MACHINE64" ;if 64bit system, modify hive location

RegRead($sHive & 'SYSTEMCurrentControlSetControlNetwork{4D36E972-E325-11CE-BFC1-08002bE10318}{392A3E19-A094-4323-9B6B-EC40BD939853}', "Name")

I actually loop through an already enumerated array list of values for the last {} section, but for ease of troubleshooting I inserted an existing value from my registry. This always comes up with an error of -1 and the key "Name" does exist. If you are curious I am scripting network settings and this {4D36E972-E325-11CE-BFC1-08002bE10318} is the location of the network interfaces while {392A3E19-A094-4323-9B6B-EC40BD939853} is a specific device. "Name" is a "REG_SZ" that holds the actually windows name of the network interface (ex. "Local Area Connection").

Link to comment
Share on other sites

  • Solution

Are you sure the "Name" isn't under Connection under the Key? That's how it is for me and the code works... So:

RegRead($sHive & 'SYSTEMCurrentControlSetControlNetwork{4D36E972-E325-11CE-BFC1-08002bE10318}{392A3E19-A094-4323-9B6B-EC40BD939853}Connection', "Name")

s!mpL3 LAN Messenger

Current version 2.9.9.1 [04/07/2019]

s!mpL3 LAN Messenger.zip

s!mpL3

Link to comment
Share on other sites

Ah man, you know I think I was just on programming overload last night. Thanks for catching that and you are exactly right. It is all ways good to have a fresh pair of eyes to look at something.  :thumbsup:

Edited by adbcode
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...