Sign in to follow this  
Followers 0
adbcode

RegRead Issue

3 posts in this topic

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").

Share this post


Link to post
Share on other sites



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.8.8 [30/09/2015]

Download Here

s!mpL3

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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

Share this post


Link to post
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
Sign in to follow this  
Followers 0