nick1812 Posted July 1, 2007 Posted July 1, 2007 Hi All, I'm trying to open a reg-file with AutoIt that was exported with regedit /e (Windows XP Pro) For some reason M$ found it necessary to start an exported regfile with the 2 characters ÿþ (Hex: FF FE) I can guess why, because that's exactly the reason AutoIt won't read the file properly. Right now my best 'fix' so far is to have GWBasic (for all sakes) read/rewrite the file, because GWBasic ignores the 2 first characters of the reg-file. After that I can open the rewritten file in AutoIt... Anybody knows a faster/better/easier solution?? Greetz, Arjan
BullGates Posted July 1, 2007 Posted July 1, 2007 Hi All, I'm trying to open a reg-file with AutoIt that was exported with regedit /e (Windows XP Pro) For some reason M$ found it necessary to start an exported regfile with the 2 characters ÿþ (Hex: FF FE) I can guess why, because that's exactly the reason AutoIt won't read the file properly. Right now my best 'fix' so far is to have GWBasic (for all sakes) read/rewrite the file, because GWBasic ignores the 2 first characters of the reg-file. After that I can open the rewritten file in AutoIt... Anybody knows a faster/better/easier solution?? Greetz, Arjan I don't understand your problem, I can open and read such files without any problem: $file = FileOpen("c:\testt.reg", 0) ; Check if file opened for reading OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf ; Read in lines of text until the EOF is reached While 1 $line = FileReadLine($file) If @error = -1 Then ExitLoop MsgBox(0, "Line read:", $line) Wend FileClose($file) As documented in AutoIt: "Both ANSI and UTF16/UTF8 text formats can be read - AutoIt will automatically determine the type." [topic="51913"]Restrict USB Storage usage to group membership[/topic] * [topic="48699"]Using nircmd library[/topic] * Some admin notes
ChrisL Posted July 1, 2007 Posted July 1, 2007 the regfile is in unicode download the latest autoit release which supports unicode then try again [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire
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