Jump to content

Recommended Posts

Posted (edited)

@Chimp

i ran you script and it display all blank feilds.

what i am trying to accomplish is to read certain key values in all of the keynames.

@JohnOne

Im getting this error:

"C:Rules.au3" (23) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.:

post-75109-0-57225900-1406921490.png

Edited by antmar904
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][3] ; <<<<<<<<<<<
    $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

could you please check if this part {0019208f-a583-4b8c-bff0-159f22abf6f7} of the key is correct in my listing?

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

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

Posted

One last request,

Can we make the array display a little nicer maybe disply in a msgbox or something else and add colum headers to each feild?

Col 0 = GUID

Col 1 = Rule Name

Col 2 = Group Policy Name

Col 3 = Program Path

 

 

post-75109-0-19519700-1406922409_thumb.p

Posted

@Chimp,

Sorry,

Its was showing blank because that rule is no longer being applied to the computer so it gets deleted from the registry.

If i change the key (GUID) here are the results:

Thanks again.

 

post-75109-0-27073800-1406922599_thumb.p

Posted

ok, thanks for checking, I was wondering why of that blank result :)

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

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

Posted

It does not matter what index i put in there i still get a blank msg box window.

MsgBox ($MB_SYSTEMMODAL, "Applied Rules", _ArrayToString ($SubKeys, "|", 0, 5))

MsgBox ($MB_SYSTEMMODAL, "Applied Rules", _ArrayToString ($SubKeys, "|", 0, 2))

MsgBox ($MB_SYSTEMMODAL, "Applied Rules", _ArrayToString ($SubKeys, "|", 0, 1))
Posted (edited)

_ArrayToString() in previous versions of AutoIT allows only the use of 1D array

maybe you have not one of the last versions of AutoIt

... you could build the desired string within the For - Next loop instead of populating the array...

post an example of how would you like to format the output in your MsgBox

Edited by Chimp

 

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