Dan Posted April 10, 2004 Author Share Posted April 10, 2004 (edited) Thanks, I changed and updated original post. Note to self: In the future, don't code with a hangover. Edited April 10, 2004 by Dan Link to comment Share on other sites More sharing options...
ahfs1 Posted April 15, 2004 Share Posted April 15, 2004 Dan, Thanks so much, it works great and saves a ton of time! Link to comment Share on other sites More sharing options...
this-is-me Posted May 19, 2004 Share Posted May 19, 2004 Just a small note, I like to comment what I am doing in my .reg files. Your script does not take any comments into account (comments meaning anything starting with ";"). It throws an error when a comment is encountered. Who else would I be? Link to comment Share on other sites More sharing options...
bshoenhair Posted May 21, 2004 Share Posted May 21, 2004 Dan I exported a registration key for an app then ran the script but the script eliminated the last 2 characters. Try this: [HKEY_LOCAL_MACHINE\SOFTWARE\MyAppsAuthor\MyAppsName\Key] "Key"="OEQDA==" Link to comment Share on other sites More sharing options...
bshoenhair Posted May 22, 2004 Share Posted May 22, 2004 (edited) Dan There is a problem when the valuedata contains a "=" in it. I have a few appz I have purchased with serials that contain "=". Example: lkuyshoriufjkhiucs=lkuahgkdjAOcxzc== The following will eliminate this problem and I am hoping you will update your post to reflect it. If I am wrong please correct me, I am a quick learner but still very new to AutoIt Scripting. Remove: $TEMP = StringSplit($TEXT, "=");split line into value and valuedata And replace with: For $I = 1 To StringLen($TEXT) If StringMid( $TEXT, $I, 1) = "=" Then $TEMP1 = StringLeft($TEXT, $I - 1) $TEMP2= StringTrimLeft($TEXT, $I) ExitLoop EndIf Next Then you need to replace the following in the entire script: $TEMP[1] with $TEMP1 and $TEMP[2] with $TEMP2 Edited May 22, 2004 by bshoenhair Link to comment Share on other sites More sharing options...
Dan Posted June 6, 2004 Author Share Posted June 6, 2004 (edited) In looking at the script, i found a couple more issues related to " and = characters in names and data. I made the simple change to allow for comments as requested and will check out the remaining issue within the next few days. Edited June 8, 2004 by Dan Link to comment Share on other sites More sharing options...
SlimShady Posted June 27, 2004 Share Posted June 27, 2004 (edited) I couldn't sleep so I made my own version.My version:adds comments (when available)Uses RegDelete instead of RegWrite when neededcan't handle "REG_MULTI_SZ" and "REG_EXPAND_SZ" (I have no idea how I can convert those...)Available below:http://www.autoitscript.com/fileman/users/public/SlimShady/Reg2Au3.au3 Edited June 27, 2004 by SlimShady Link to comment Share on other sites More sharing options...
SlimShady Posted June 27, 2004 Share Posted June 27, 2004 Updated.It now supports:"REG_SZ", "REG_MULTI_SZ", "REG_EXPAND_SZ", "REG_DWORD", "REG_BINARY".I used information from Dan's CharsToString function.Test it on a dummy registry file first to be sure that nothing scr*ws up.http://www.autoitscript.com/fileman/users/public/SlimShady/Reg2Au3.au3 Link to comment Share on other sites More sharing options...
somh Posted September 11, 2006 Share Posted September 11, 2006 Updated.It now supports:"REG_SZ", "REG_MULTI_SZ", "REG_EXPAND_SZ", "REG_DWORD", "REG_BINARY".I used information from Dan's CharsToString function.Test it on a dummy registry file first to be sure that nothing scr*ws up.http://www.autoitscript.com/fileman/users/public/SlimShady/Reg2Au3.au3Thanks but the link seems to be dead now. Link to comment Share on other sites More sharing options...
SlimShady Posted September 11, 2006 Share Posted September 11, 2006 I forgot about this one. Last time I touched it was on january 2005. I need to rewrite it. If you can't wait, the current script is attached.Reg2Au3.au3 Link to comment Share on other sites More sharing options...
sulfurious Posted September 11, 2006 Share Posted September 11, 2006 Good scripting here. Glad to see other's take interest in .reg like I do. A couple things to say here. First and foremost, unless you are working on a 9x machine, why do you export as 9x? That exports at UTF-8, which converts your UTF-16 registry (2k & xp) down to UTF-8. In simple terms, you are exporting Unicode to Ascii/ANSI. There are many characters that could be in your registry that will never be imported in again. Both binary and strings. Second, the full set of values that I can convert and use in a .reg file are: REG_SZ,REG_BINARY,REG_MULTI_SZ,REG_EXPAND_SZ,REG_DWORD,REG_QWORD,REG_FULL_RESOURCE_DESCRIPTOR and one I just found about, a Multiple-line REG_SZ (not REG_MULTI_SZ). I have been working on a script to convert .reg to .inf. I was doing as you, with UTF-8, but have found numerous reasons to keep the Unicode. Also, there is a method to simply convert Unicode to Ascii by using the Run(@comspec) & Type command. This will work, but not on hex(7) (reg_multi_sz) values. Because the binary is actually a hex value of what a hex value should import as, the conversion has no need to convert binary, so it leaves it. Meaning when you parst hex(7) thinking it is UTF-8, it is still UTF-16 binary, which needs to be converted to Chars of the hex, which can then be Char'd to string. Umm. Somewhat confusing. Just look at a Unicode .reg file for hex(7) values, and do a char function on it to see what I mean. It needs it twice. This means nothing though if you export as 9x, because any UTF-16 is not there. later, Sul Link to comment Share on other sites More sharing options...
sulfurious Posted September 11, 2006 Share Posted September 11, 2006 Also add to the list hex 8 value of REG_RESOURCE_LIST hex A value of REG_RESOURCE_REQUIREMENTS_LIST Link to comment Share on other sites More sharing options...
Gnomercy Posted September 11, 2006 Share Posted September 11, 2006 For those who just needs to run an existing .reg file named myregfile.reg in c:\ run("c:\windows\regedit.exe /s c:\myregfile.reg") Link to comment Share on other sites More sharing options...
Redbeard Posted March 6, 2007 Share Posted March 6, 2007 (edited) Extremely useful! Thanks for the script, how's that update going? Edited March 6, 2007 by Redbeard Link to comment Share on other sites More sharing options...
Jazkal Posted July 4, 2007 Share Posted July 4, 2007 (edited) Anyone have a modified script that can handle Hex A and Hex 8 values? EDIT: For those telling me I should have posted this in the General Support forum, I'm sorry, didn't know that. Thought I was asking for an "example script", but now I know you don't ask for "example scripts" in the "example script" forum. Got it, won't happen again. Edited July 5, 2007 by Jazkal 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