Jump to content

Read Reg


Go to solution Solved by Gianni,

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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)

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • Solution

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

Link to comment
Share on other sites

@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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...