antmar904 Posted July 30, 2014 Posted July 30, 2014 Hi All, I am trying to read the Data for the Name "(Default)" under HKLMSoftwareBeyondTrustSDApplicationsRulesMachine{ANY NUMBER} and all sub folders. I tried using RegRead and RegEnumKey.
JohnOne Posted July 30, 2014 Posted July 30, 2014 Show code. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
antmar904 Posted July 31, 2014 Author Posted July 31, 2014 Im trying to display all of the sub folders in HKLMSoftwareBeyondTrustSDApplicationsRulesMachine in an array for starters and it is not working. Local $var = "" For $i = 1 To 100 $var = RegEnumKey("HKLM\Software\BeyondTrust\SD\Applications\Rules\Machine", $i) If @error <> 0 Then ExitLoop _ArrayDisplay ($i) Next
JohnOne Posted July 31, 2014 Posted July 31, 2014 Not hot on reg off top of head try.. Local $var = "" For $i = 1 To 100 $var = RegEnumKey("HKLM\Software\BeyondTrust\SD\Applications\Rules\Machine", $i) If @error <> 0 Then ExitLoop ConsoleWrite(RegRead($var, "") & @LF) Next AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
JohnOne Posted July 31, 2014 Posted July 31, 2014 Local $var = "" For $i = 1 To 100 $var = RegEnumKey("HKLM\Software\BeyondTrust\SD\Applications\Rules\Machine", $i) If @error <> 0 Then ExitLoop ConsoleWrite(RegRead("HKLM\Software\BeyondTrust\SD\Applications\Rules\Machine\" & $var, "") & @LF) Next AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Gianni Posted July 31, 2014 Posted July 31, 2014 maybe this? #include <array.au3> Local $var = "", $SubKeys[1] For $i = 1 To 100 $var = RegEnumKey("HKLM\Software\BeyondTrust\SD\Applications\Rules\Machine", $i) If @error <> 0 Then ExitLoop _ArrayAdd($SubKeys, $var) $SubKeys[0] += 1 Next _ArrayDisplay($SubKeys) Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....
antmar904 Posted July 31, 2014 Author Posted July 31, 2014 @Chimp That worked. How would i see the value for the key named "(Default)" in each of the sub folders? Thank you all for your help.
Gianni Posted July 31, 2014 Posted July 31, 2014 if you only need the "(Default)" value then this should do: #include <array.au3> Local $var = "", $SubKeys[1][2] Local $Key = "HKLM\Software\BeyondTrust\SD\Applications\Rules\Machine" For $i = 1 To 100 $var = RegEnumKey($Key, $i) If @error <> 0 Then ExitLoop _ArrayAdd($SubKeys, $var) $SubKeys[$i][1] = RegRead($Key & "\" & $SubKeys[$i][0], "") $SubKeys[0][0] += 1 Next _ArrayDisplay($SubKeys) Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....
antmar904 Posted July 31, 2014 Author Posted July 31, 2014 Thank you Chimp but the code above gives me no output. Here is a screenshot of what data i would like to get within each sub folder:
JohnOne Posted July 31, 2014 Posted July 31, 2014 Did you try my code or blank it? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
antmar904 Posted July 31, 2014 Author Posted July 31, 2014 @JohnOne I just saw your second code post, I just tried it and still i get no output.
Solution Gianni Posted July 31, 2014 Solution Posted July 31, 2014 could you try this? #include <array.au3> Local $var = "", $SubKeys[1][2] Local $Key = "HKLM\Software\BeyondTrust\SD\Applications\Rules\Machine" For $i = 1 To 100 $var = RegEnumKey($Key, $i) If @error <> 0 Then ExitLoop ReDim $SubKeys[UBound($SubKeys) + 1][2] $SubKeys[$i][0] = $var $SubKeys[$i][1] = RegRead($Key & "\" & $SubKeys[$i][0], "") $SubKeys[0][0] += 1 Next _ArrayDisplay($SubKeys) Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....
antmar904 Posted July 31, 2014 Author Posted July 31, 2014 (edited) @Chimp That worked great, I would've never figured that one out. FYI, Here is what the output looks like: Thank you all for your help. Edited July 31, 2014 by antmar904
Gianni Posted July 31, 2014 Posted July 31, 2014 you are welcome Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....
antmar904 Posted August 1, 2014 Author Posted August 1, 2014 @Chimp How hard would it be if i wanted to get other data from other keys within the same folder? Right now i am only gathering the data from the "(Default)" key and would like to also get the data from "gponame". Ive tried editing your script but failed miserably.
JohnOne Posted August 1, 2014 Posted August 1, 2014 RegRead($Key & "" & $SubKeys[$i][0], "gponame") AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
antmar904 Posted August 1, 2014 Author Posted August 1, 2014 @JohnOne, When i add RegRead($Key & "\" & $SubKeys[$i][0], "gponame") it gets rid of the "(Default)" value. How can i see them both?
JohnOne Posted August 1, 2014 Posted August 1, 2014 #include <array.au3> Local $var = "", $SubKeys[1][3] Local $Key = "HKLM\Software\BeyondTrust\SD\Applications\Rules\Machine" For $i = 1 To 100 $var = RegEnumKey($Key, $i) If @error <> 0 Then ExitLoop ReDim $SubKeys[UBound($SubKeys) + 1][2] $SubKeys[$i][0] = $var $SubKeys[$i][1] = RegRead($Key & "\" & $SubKeys[$i][0], "") $SubKeys[$i][2] = RegRead($Key & "\" & $SubKeys[$i][0], "gponame") $SubKeys[0][0] += 1 Next _ArrayDisplay($SubKeys) AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Gianni Posted August 1, 2014 Posted August 1, 2014 @Chimp How hard would it be if i wanted to get other data from other keys within the same folder? Right now i am only gathering the data from the "(Default)" key and would like to also get the data from "gponame". Ive tried editing your script but failed miserably. to read a single KeyValue use the RegRead passing the Keyname (HKLMSoftwareBeyondTrustSDApplicationsRulesMachine{0019208f-a583-4b8c-bff0-159f22abf6f7}) and the Valuename (gponame in your case) or you could read all the values of that Keyname in this way for example: #include <array.au3> Local $var = "", $i = 0 ,$SubKeys[1][2] Local $Key = "HKLM\Software\BeyondTrust\SD\Applications\Rules\Machine\{0019208f-a583-4b8c-bff0-159f22abf6f7}" While True $i +=1 $var = RegEnumVal($Key, $i) If @error <> 0 Then ExitLoop ReDim $SubKeys[UBound($SubKeys) + 1][2] $SubKeys[$i][0] = $var $SubKeys[$i][1] = RegRead($Key , $SubKeys[$i][0]) $SubKeys[0][0] = $i WEnd _ArrayDisplay($SubKeys) Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....
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