Jump to content

Recommended Posts

Posted

Say that....

HKLMSystemCurrentControlSetControlClassABC contains several different subkeys, such as

HKLMSystemCurrentControlSetControlClassABC123

HKLMSystemCurrentControlSetControlClassABC456

HKLMSystemCurrentControlSetControlClassABC789

Within one of these three subkeys, lies a value name that needs to be changed - we'll call it VALNAME. So it would need to find which one of those three subkeys holds VALNAME - which would be modified.

I am thinking I could just use regread to search for it, but am curious on the best way to parse through them (There are way more than 3 subkeys to search through; this is purely for example)

  • Moderators
  • Solution
Posted

Taken almost word for word from the example under RegEnumKey...

$path = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\ABC\"
For $i = 1 To 100
    $sSubKey = RegEnumKey($path, $i)
        If @error Then
            ExitLoop
        Else
            $var = RegRead($path & $sSubKey, "VALNAME")
                    If Not @error Then MsgBox(0, $path & $sSubKey, $var)
        EndIf
Next

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

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