sainthuang Posted May 13, 2017 Posted May 13, 2017 ; My source below Local $sSubKey = "" For $i = 1 To 1 $sSubKey = RegEnumKey("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}", $i) If @error Then ExitLoop $Var = ("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\" & $sSubkey) Next ;.................................................................................................................................................................................................................................... but question is how to identify the folder such the folder will have "0000" and "0001"...with "properties"...I just only want to check last maybe called as "0009" and bypass "Properties" Could someone help me to show me how to do ? thanks!
Subz Posted May 13, 2017 Posted May 13, 2017 (edited) You could do something like this. #include <Array.au3> Local $i = 1, $sRegKey = "HKLM\SYSTEM\ControlSet001\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}", $sSubKey, $aSubKey[1] While 1 $sSubKey = RegEnumKey($sRegKey, $i) If @error Then ExitLoop If StringLen($sSubKey) = 4 Then _ArrayAdd($aSubKey, $sRegKey & "\" & $sSubKey) $i += 1 WEnd $aSubKey[0] = UBound($aSubKey) - 1 _ArrayDisplay($aSubKey) MsgBox(48, "Last Reg Key", $aSubKey[$aSubKey[0]]) Edited May 13, 2017 by Subz sainthuang 1
sainthuang Posted May 13, 2017 Author Posted May 13, 2017 hi Subz: It's very useful for me...thanks for the great help quickly! BTW, could I use a variable as called "$Var" to determine it whole string on my specific item not a Array? $Var = $aSubKey[$aSubKey[0]] Thank you very much!
Subz Posted May 13, 2017 Posted May 13, 2017 That's correct, I just used the MsgBox as an example on how to get the last key but your code above would work as well. Cheers
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