GAM Posted July 26, 2014 Share Posted July 26, 2014 Hi Am trying to list out all the keys and subkeys under the registry path "HKLMSOFTWAREWow6432NodeMyCompany"; and am able to get the out put successfully. But there are other registry paths from where I have to retrieve the data which are dynamic in naming convention here am failing to get the output. The only thing that does NOT change in the naming convention is the first three letters "MFK". I have tried the below script by using "*" but that does NOT work. $RegPathOfRoot = "HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMFK*" Any help please! Thanks in Advance. --------------------------------------------------------------------------------------------------------------------------------------------------------- #include <MsgBoxConstants.au3> #include <FileConstants.au3> $sFilePath = "FileWriteLine.txt" $sSubKey = "" $RegPathOfRoot = "HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMyCompanyDesktopProtection" recursiveGetReg($RegPathOfRoot) Func recursiveGetReg($RegPath) $hFileOpen = FileOpen($sFilePath, $FO_APPEND) If $hFileOpen = -1 Then MsgBox($MB_SYSTEMMODAL, "", "An error occurred when reading the file.") Return False EndIf For $i = 1 To 200 $sSubKey = RegEnumKey($RegPath, $i) If @error Then ExitLoop Local $sVar = "" For $j = 1 To 500 $sVar = RegEnumVal($RegPath & "" & $sSubKey, $j) If @error <> 0 Then ExitLoop FileWriteLine($hFileOpen, $RegPath & "" & $sSubKey & "" & $sVar & @CRLF) ;Sleep(200) ;RegDelete($RegPath & "" & $sSubKey, $sVar) Next If RegEnumKey($RegPath & "" & $sSubKey, 1) = "" Then Else recursiveGetReg($RegPath & "" & $sSubKey) EndIf Next FileClose($hFileOpen) EndFunc --------------------------------------------------------------------------------------------------------------------------------------------------------- Neil Link to comment Share on other sites More sharing options...
Geir1983 Posted July 26, 2014 Share Posted July 26, 2014 (edited) RegEnumKey Local $i=0, $substring="MFK" While 1 $i= $i+1 $sSubKey = RegEnumKey("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node", $i) If @error Then ExitLoop If StringLeft($sSubKey, 3) = $substring Then ConsoleWrite($sSubKey &@crlf) WEnd Edited July 26, 2014 by Geir1983 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