Fzz Posted December 12, 2003 Posted December 12, 2003 I did a search for this and then realized...there's not much here. Nice new look though. I'm trying to do a search and replace on some registry files that I've exported. When I try to open the files with FileReadLine() it give me junk. Actually is give me this:ÿþW If I open the .reg file in notepad and then paste it into a new reg file it works fine. It looks like it's a problem with the file I exported with regedit. Also, when I open it with NotepadEx it says the format is "DOS / Unicode (UTF16-LE) If I just type it out from dos...it looks ok. Any ideas? Thanks Fz
Davman Posted July 22, 2004 Posted July 22, 2004 I get this as well... i ended up opening the file in notepad and reading the contents manually. Sitting comfortably behind the code.
sugi Posted July 22, 2004 Posted July 22, 2004 the dos command type is able to read unicode files. just do type unicode.txt > normal.txt and you've got a plain text file. or just save the regfile from regedit in a different format (regedit offers a few in the save as dialog)
this-is-me Posted July 22, 2004 Posted July 22, 2004 When you say regsistry files, do you mean in xp/2k or 9x? Who else would I be?
kristoff Posted July 22, 2004 Posted July 22, 2004 Hi,You make a seach under particular keys or whole registry ?I wrote a script ( inspire from http://www.autoitscript.com/forum/index.php?showtopic=1157& from scriptkitty ), wich look under uninstall reg keys ( "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" ), export it to a file, then scan the file to search a word, read the key, then delete the key within the registry. Just because each update of my application create a new key.
CyberSlug Posted July 22, 2004 Posted July 22, 2004 (edited) You can convert the unicode to normal text by running it through the "type" console command.... The general syntax is: RunWait("cmd /c type oldFile.reg > newFile.reg")$original = "C:\Documents and Settings\Administrator\Desktop\RegistryFile.reg" $new = "C:\Documents and Settings\Administrator\Desktop\new.reg" RunWait('cmd /c type "' & $original & '" > "' & $new & '"') $file = FileOpen($new, 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) Edited July 22, 2004 by CyberSlug Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
sykes Posted July 22, 2004 Posted July 22, 2004 (edited) I had this issue a while back and Jpm helped me figure it out. It seems exporting it in 9x format makes it readable.Read Me Edited July 22, 2004 by psichosis We have enough youth. How about a fountain of SMART?
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