obfuscatedv Posted May 2, 2014 Share Posted May 2, 2014 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) Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted May 2, 2014 Moderators Share Posted May 2, 2014 Look at RegEnumKey in the help file. "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! Link to comment Share on other sites More sharing options...
obfuscatedv Posted May 2, 2014 Author Share Posted May 2, 2014 Ok, so using RegEnumKey. For example, For $i = 1 to 20 Local $var = RegEnumKey("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\ABC\", $i) How should you parse through each of those three subkeys above to find "VALNAME"? Link to comment Share on other sites More sharing options...
Moderators Solution JLogan3o13 Posted May 2, 2014 Moderators Solution Share Posted May 2, 2014 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 obfuscatedv 1 "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! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now