antmar904 Posted August 1, 2014 Author Share Posted August 1, 2014 (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.: Edited August 1, 2014 by antmar904 Link to comment Share on other sites More sharing options...
JohnOne Posted August 1, 2014 Share 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][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. Link to comment Share on other sites More sharing options...
antmar904 Posted August 1, 2014 Author Share Posted August 1, 2014 That worked thank you again. Now the fun part is trying to better understand how this all works. Link to comment Share on other sites More sharing options...
Gianni Posted August 1, 2014 Share Posted August 1, 2014 could you please check if this part {0019208f-a583-4b8c-bff0-159f22abf6f7} of the key is correct in my listing? Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
antmar904 Posted August 1, 2014 Author Share Posted August 1, 2014 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 Link to comment Share on other sites More sharing options...
antmar904 Posted August 1, 2014 Author Share Posted August 1, 2014 @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. Link to comment Share on other sites More sharing options...
Gianni Posted August 1, 2014 Share Posted August 1, 2014 ok, thanks for checking, I was wondering why of that blank result Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
antmar904 Posted August 1, 2014 Author Share Posted August 1, 2014 np, thanks again. hats off to you and johnone Link to comment Share on other sites More sharing options...
JohnOne Posted August 1, 2014 Share Posted August 1, 2014 _ArrayDisplay($SubKeys, "Title", "", 0, Default, "Key|Default|gponame") 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 More sharing options...
antmar904 Posted August 1, 2014 Author Share Posted August 1, 2014 Thank you JohnOne. This is not working: MsgBox ($MB_SYSTEMMODAL, "Applied Rules", _ArrayToString ($SubKeys, "|", 1, 0)) Link to comment Share on other sites More sharing options...
JohnOne Posted August 1, 2014 Share Posted August 1, 2014 You're starting at index 1 and ending at index 0 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 More sharing options...
antmar904 Posted August 5, 2014 Author Share Posted August 5, 2014 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)) Link to comment Share on other sites More sharing options...
antmar904 Posted August 5, 2014 Author Share Posted August 5, 2014 anyone? Link to comment Share on other sites More sharing options...
Gianni Posted August 5, 2014 Share Posted August 5, 2014 (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 August 5, 2014 by Chimp Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
antmar904 Posted August 5, 2014 Author Share Posted August 5, 2014 @Chimp I did not know that there was a newer version out. I did update to the latest release and _ArrayToString is now working. Thanks again. Link to comment Share on other sites More sharing options...
Gianni Posted August 5, 2014 Share Posted August 5, 2014 you're welcome Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
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