Jump to content

Recommended Posts

Posted

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

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

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
  • Recently Browsing   0 members

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