Jump to content

Recommended Posts

Posted

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.

 

post-75109-0-07327700-1406753855_thumb.p

Posted

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.

Posted

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)

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

  • Solution
Posted

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)

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

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

post-75109-0-92619900-1406840180_thumb.p

Edited by antmar904
Posted

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

 

 

post-75109-0-08492700-1406899907_thumb.p

Posted

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

Posted

@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)

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

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