Docfxit Posted October 30, 2014 Share Posted October 30, 2014 (edited) I found a script that claims to read registry keys into an array here: I tried to read a registry key and it's giving me all the values, instead of only the "*AutoAdminLogon*" value I requested. The code I'm using is: #RequireAdmin #include <Array.au3> #include <_RegEnumKeyValEx.au3> Global $a, $Error, $Extended, $KeyName $KeyName = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" $a = _RegEnumValEx($KeyName, 128 + 256 + 32, "*","*AutoAdminLogon*") $Error = @Error $Extended = @Extended ConsoleWrite("Return = " & $a & " - $Error = " & $Error & " - $Extended = " & $Extended & @LF) _ArrayDisplay($a) ;Does not show number of entries displayed Thanks, Docfxit All credit for the attached script goes to the author: DXRW4E Edited October 30, 2014 by Docfxit Link to comment Share on other sites More sharing options...
guinness Posted October 30, 2014 Share Posted October 30, 2014 Please remove that code from you post and instead link to the UDF page. Have a little respect for UDF authors will you. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
Docfxit Posted October 30, 2014 Author Share Posted October 30, 2014 I have all the respect in the world. That's why I gave him all the credit. I thought it would be easier for someone to test my code. I am very sorry if I didn't show enough respect. I have removed it from my post. Thanks for letting me know that was not appropriate. Docfxit mLipok 1 Link to comment Share on other sites More sharing options...
AutID Posted October 30, 2014 Share Posted October 30, 2014 (edited) Edit: Modified your first post?! Don't expect much help like this ; Return values .: Success - Return Array List (See Remarks) ; Failure - @Error ; |3 = Invalid $sFilter ; |4 = No Value-Name(s) Found Edited October 30, 2014 by AutID https://iblockify.wordpress.com/ Link to comment Share on other sites More sharing options...
Docfxit Posted October 30, 2014 Author Share Posted October 30, 2014 Edit: Modified your first post?! Don't expect much help like this ; Return values .: Success - Return Array List (See Remarks) ; Failure - @Error ; |3 = Invalid $sFilter ; |4 = No Value-Name(s) Found I found my first error before anyone else posted a resolution. I fixed the error I found so I could get help on the remaining errors. In my first post I had 4 = No Value-Name(s) Found. Thanks for you input, Docfxit Link to comment Share on other sites More sharing options...
Solution Docfxit Posted October 30, 2014 Author Solution Share Posted October 30, 2014 I found the resolution to my question. This is my current code that does work: #RequireAdmin #include <Array.au3> #include <_RegEnumKeyValEx.au3> Global $a, $Error, $Extended, $KeyName $KeyName = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" $a = _RegEnumValEx($KeyName, 128 + 256 + 32, "AutoAdminLogon") $Error = @Error $Extended = @Extended ConsoleWrite("Return = " & $a & " - $Error = " & $Error & " - $Extended = " & $Extended & @LF) _ArrayDisplay($a) ;Does not show number of entries displayed Thank you, Docfxit Link to comment Share on other sites More sharing options...
guinness Posted October 30, 2014 Share Posted October 30, 2014 I have all the respect in the world. That's why I gave him all the credit. I thought it would be easier for someone to test my code. I am very sorry if I didn't show enough respect. I have removed it from my post. Thanks for letting me know that was not appropriate. Docfxit Much appreciated, thanks. It's just duplicating code is bad news if the UDF is updated and then we have old outdated code laying around. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
Docfxit Posted October 30, 2014 Author Share Posted October 30, 2014 I didn't think of that. Thanks for letting me know. I was just trying to make it easier for someone to test my code. Thanks, Docfxit Link to comment Share on other sites More sharing options...
DXRW4E Posted October 31, 2014 Share Posted October 31, 2014 (edited) Hi All, however for the info, Microsoft says it will do so http://support.microsoft.com/kb/128731 that should be in autoit '?do=embed' frameborder='0' data-embedContent>>Ciao. Edited October 31, 2014 by DXRW4E Link to comment Share on other sites More sharing options...
DXRW4E Posted October 31, 2014 Share Posted October 31, 2014 (edited) Firefox (Aurora) problem ehhh, please delete post Edited October 31, 2014 by DXRW4E Link to comment Share on other sites More sharing options...
DXRW4E Posted October 31, 2014 Share Posted October 31, 2014 (edited) Firefox (Aurora) problem ehhh, please delete post Edited October 31, 2014 by DXRW4E Link to comment Share on other sites More sharing options...
Docfxit Posted October 31, 2014 Author Share Posted October 31, 2014 Thank you for the post. Hi All, however for the info, Microsoft says it will do so http://support.microsoft.com/kb/128731 that should be in autoit '?do=embed' frameborder='0' data-embedContent>> Ciao. Thank you for the post. If I understand you correctly, I should be using SaveRegistryKey script instead of _RegEnumKeyValEx.au3 ? Does that also have the capabilty to RestoreRegistryKey? Thank you very much for your scripts. Docfxit Link to comment Share on other sites More sharing options...
DXRW4E Posted October 31, 2014 Share Posted October 31, 2014 (edited) Hi Docfxit,AutoIt Native Function are the fastest ehhhhh, but in this case have bugs, see the limit of 512 levels of the log regkeyname, so I think is better to use (SaveRegistryKey) RegistryEx.au3, it may be slower but more safer, however I've updated the RegistryEx.au3 added _WinAPI_RegRestoreKeyremember the main purpose of these scripts is more to show how to do something, after each user will be able to do even better, I mean even you yourself can checkeditupdateimprove the script, adapting it according to your requirements etc etc Ciao. Edited October 31, 2014 by DXRW4E 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