Jump to content

FileOpen & FileReadLine on .reg file errors


Recommended Posts

Export a regkey with any version of windows.

Fileopen it.

while 1

(readline)

if @error = -1 = this creates an endless loop, never stops

msgbox (line) = looks like binary, only reads one line

Wend

Seems even if I FileCopy it as .txt, same issue. Is there some sort of encoding that happens when it is exported as a .reg file? Is it possible to read a .reg file as text?

Help!

Thanks,

Sul

Link to comment
Share on other sites

Export a regkey with any version of windows.

Fileopen it.

while 1

(readline)

if @error = -1 = this creates an endless loop, never stops

msgbox (line) = looks like binary, only reads one line

Wend

Seems even if I FileCopy it as .txt, same issue. Is there some sort of encoding that happens when it is exported as a .reg file? Is it possible to read a .reg file as text?

Help!

Thanks,

Sul

The registry data is output as unicode.

Search this forum for lots of discussion on converting to ASCII, if desired... :P

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

LOL. That was stupid on my part. I used this

Run(@Comspec & ' /c FIND /V "some string never found" c:\file.reg >c:\newfile.reg)

while you were posting on searching for conversions. I had looked up .reg and registry & converions, but did not add the ASCII. I found what you were talking about right away. I should have known to be using Type. I just forgot about it and used Find instead. Type is better because it does not add the --------Found information at the top.

Thanks for the help.

Sul

Link to comment
Share on other sites

#include <file.au3> 

Global $filein,$line
$filein = FileOpen(@DesktopDir & "aaa.reg",0)
while 1
    $line = FileReadLine($filein)
    if @error = -1 then ExitLoop
    MsgBox(0,"",$line)
WEnd
You are missing the backslash in your "path\to\the\regfile" :P and this will cause failure.
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...