Jump to content

AutoIt won't read exported registry file


Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...