thexshadow Posted February 27, 2010 Share Posted February 27, 2010 Yes, I know this has been posted before. I have found a few posts on it. I don't really want to use _RegSearch(). I came across: This.I tried to edit it to my liking, but I couldnt get it to work.Local $pattern = "[[:xdigit:]]+" Local $regkey = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\rno\S9", "Serial_") If StringRegExp($regkey, $pattern) Then MsgBox(64, "Info", "Works") Else MsgBox(16, "Error", "Not working") EndIfI do not know the ten numbers following the Serial_. Would anyone know what to do here? Link to comment Share on other sites More sharing options...
PsaltyDS Posted February 28, 2010 Share Posted February 28, 2010 If you don't want to use _RegSearch() or your own version of it, you'll have to use RegEnumKey() in a loop and test each name for your pattern. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
thexshadow Posted March 1, 2010 Author Share Posted March 1, 2010 I guess I could use _RegSearch(). I just wanted to see if there was anything else. I'll see what I can come up with. Link to comment Share on other sites More sharing options...
thexshadow Posted March 2, 2010 Author Share Posted March 2, 2010 (edited) Sorry for the double post. I have played around for a bit and this is what I came up with. But I got stuck on the data, I cant really think of a way to get the data instead of Serial_XXXXXXXXXX. Serial_ is the name, and I need to get the data from it, any ideas? I know it's something simple. I will use RegSearch if it will be easier.While 1 $Key = RegEnumVal("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\rno\S9", 1) If @error = -1 Then ExitLoop If Not @error And StringRegExp($Key, 'Serial_\d') Then MsgBox(-1, "", $Key) ContinueLoop EndIf WEnd Edited March 2, 2010 by thexshadow Link to comment Share on other sites More sharing options...
PsaltyDS Posted March 2, 2010 Share Posted March 2, 2010 I meant more like this: Local $sParentKey = "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\rno\S9" For $n = 1 To 1024 $sValue = RegEnumVal($sParentKey, $n) If @error Then ExitLoop If StringRegExp($sValue, 'Serial_\d+') Then $vData = RegRead($sParentKey, $sValue) ConsoleWrite($n & ": " & $sParentKey & "\" & $sValue & " = " & $vData & @LF) EndIf Next Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Remo1075 Posted March 10, 2010 Share Posted March 10, 2010 Hi, stumbled accross this and it looks like it's what I'm looking for. How would I take this a little further and make part of the regread a wildcard? You have RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\rno\S9" If it was maybe S9, S8 or S7. Link to comment Share on other sites More sharing options...
PsaltyDS Posted March 10, 2010 Share Posted March 10, 2010 Then the parent key would be "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\rno", and you change the StringRegExp() test to look for what you want. If you don't like the StringRegExp(), just replace it with StringInStr() or some other test as required. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law 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