Olish Posted August 14, 2006 Share Posted August 14, 2006 (edited) Hello everybody ! I'm trying to make a program that reads a REG file. I tried with IniReadSectionNames to retrieve registry key names, but it doesn't read more than 568 keys... I tried also with FileReadLine but the REG file is not readable. Is this file too big ? What are the limitations for these functions ? EDIT : It takes 45 seconds to open with the Notepad. So I opened the file with AutoIt and the script waits more than 45 seconds before reading lines, but this doesn't run... Thank you a lot for helping me ! Edited August 14, 2006 by Olish Olivier, from France.Free Wake On LAN script Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 14, 2006 Moderators Share Posted August 14, 2006 (edited) I know Valik put a limitation on the Section names... but I don't know anything about why FileRead is failing (unless you're using it wrong... but we wouldn't know that :hint: ). Edit: I don't know how reliable this would be... using AutoIt 3.2 you could try this: Local $File = FileRead(@DesktopDir & '\TEST.AU3.ini') Local $aSNames = _SRE_BetweenEX($File, '\[', '\]') If Not @error Then For $iCount = 0 To UBound($aSNames) - 1 MsgBox(0, 'Number of Sections = ' & UBound($aSNames) - 1, _ $aSNames[$iCount]) Next EndIf Func _SRE_BetweenEX($s_String, $s_Start, $s_End, $iCase = 'i') If $iCase <> 'i' Then $iCase = '' $a_Array = StringRegExp($s_String, '(?' & $iCase & _ ':' & $s_Start & ')(.*?)(?' & $iCase & _ ':' & $s_End & ')', 3) If @extended & IsArray($a_Array) Then Return $a_Array Return SetError(1, 0, 0) EndFuncMy concern is if the values have brackets or not. Edited August 14, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Olish Posted August 14, 2006 Author Share Posted August 14, 2006 I know Valik put a limitation on the Section names...I'll try this code...Why this limitation ? Olivier, from France.Free Wake On LAN script Link to comment Share on other sites More sharing options...
Olish Posted August 14, 2006 Author Share Posted August 14, 2006 I tried with a REG file of the HKLM huge, this file is about 57000 ko. And it doesn't works. Does AutoIt can open a file that has this size ? Olivier, from France.Free Wake On LAN script Link to comment Share on other sites More sharing options...
Valik Posted August 14, 2006 Share Posted August 14, 2006 I'll try this code...Why this limitation ?Compatibility with older versions of Windows that are supported by AutoIt.You shouldn't be using registry functions to read a reg file, anyway. It's not exactly a standard INI file in a format understood by AutoIt. There may be subtle differences in how that file works and how AutoIt reads INI files that could cause a loss of data. 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