sulfurious Posted August 17, 2006 Share Posted August 17, 2006 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 More sharing options...
BPBNA Posted August 17, 2006 Share Posted August 17, 2006 A .reg file is just a plain text file. It works the same way as a .txt file as far as I know. Can we see your FileReadLines? Link to comment Share on other sites More sharing options...
PsaltyDS Posted August 17, 2006 Share Posted August 17, 2006 Export a regkey with any version of windows.Fileopen it.while 1(readline)if @error = -1 = this creates an endless loop, never stopsmsgbox (line) = looks like binary, only reads one lineWendSeems 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,SulThe registry data is output as unicode. Search this forum for lots of discussion on converting to ASCII, if desired... 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...
sulfurious Posted August 17, 2006 Author Share Posted August 17, 2006 #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 Link to comment Share on other sites More sharing options...
sulfurious Posted August 17, 2006 Author Share Posted August 17, 2006 I knew it was unicode. I saved the .reg file as all allowable filetypes. That did not work. Then I exported the registry as type xp,9x,and txt. That did not work. I will look into the conversion. Thanks. Sul Link to comment Share on other sites More sharing options...
sulfurious Posted August 17, 2006 Author Share Posted August 17, 2006 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 More sharing options...
MHz Posted August 18, 2006 Share Posted August 18, 2006 #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) WEndYou are missing the backslash in your "path\to\the\regfile" and this will cause failure. Link to comment Share on other sites More sharing options...
sulfurious Posted August 18, 2006 Author Share Posted August 18, 2006 How correct you are. The actual script I am working on had other variables to make the path. That was an example. I corrected it and still came up with ÿþS as the first line. The Type method works for now. Sul 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