Administrators Jon Posted February 6, 2004 Administrators Share Posted February 6, 2004 This one got left out of the fixing for some reason. I had problems when I wanted to write a REG_MULTI_SZ registry entry today for installing the TextPad reg entries. Ok, Kixtart's solution to the problem is to seperate each string with a pipe character | or if a real | occurs to use two ||. (for reading and writing). VBScript can't even read the registry, so no help there... It's probably something that I need to fix before final release as if we changed it later it would break things. Ideas? Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/ Link to comment Share on other sites More sharing options...
Valik Posted February 6, 2004 Share Posted February 6, 2004 An array would be nice, but I see how that could cause problems when reading since you'd have to do a check to see if the return was a string or array. I can't think of anything except a delimiter like | working well, though. Link to comment Share on other sites More sharing options...
Valik Posted February 6, 2004 Share Posted February 6, 2004 What about a non-printing character of some sort and a @macro for easy access? Link to comment Share on other sites More sharing options...
Bartokv Posted February 7, 2004 Share Posted February 7, 2004 (edited) I've never seen an example of the "REG_MULTI_SZ" registry type , but I have seen some very large "REG_BINARY" hex dumps. Regedit usually dumps these strings into a comma seperated list containing the actual hex value of each character, and using the unix-style "\" to mark the end of the line around an offset of 78 to 80 characters from the beginning of the line:[HKEY_LOCAL_MACHINE\HARDWARE\RESOURCEMAP\PnP Manager\PnpManager] "\\Device\\00000033.Raw"=hex(8):01,00,00,00,0f,00,00,00,ff,ff,ff,ff,00,00,00,\ 00,01,00,00,00,02,03,00,00,09,00,00,00,09,00,00,00,ff,ff,ff,ffWould this type of formatting be easier to incorporate?Edit:On a side note, I would like to take this time to thank Jon deciding to support any registry read/write functionality. Before I found AutoIt, I had to resort to using regedit via a batch file and use other DOS commands to parse the resulting dump:REGEDIT /E %WinTemp%\CISuinfo.txt "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Syncmgr\AutoSync\%USERDOMAIN%_%USERNAME%" FOR /F "tokens=1* delims==" %%A IN ('FIND "SID" %WinTemp%\CISuinfo.txt ^| MORE +2') DO SET SID=%%B SET SID=%SID:~1,-1% IF EXIST %WinTemp%\CIS?????.txt DEL %WinTemp%\CIS?????.txt > NUL...Needless to say, it was a pain to aquire any registry value -- and could take long periods to parse a large list of registry keys. AutoIt makes working with the registry a dream-come true... Thank you, thank you, thank you, THANK YOU!!!! Edited February 7, 2004 by Bartokv Link to comment Share on other sites More sharing options...
CyberSlug Posted February 7, 2004 Share Posted February 7, 2004 This doesn't help anyone directly, but I had posted a scripted version of reading binary registry keys--the very day before Jon added REB_BINARY support An Array might be better for RegRead instead of RegWrite. Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
Administrators Jon Posted February 7, 2004 Author Administrators Share Posted February 7, 2004 The API docs seem to say that \n is allowed with a value. But you can't do it from regedit, if you export a MULTI key and then manually edit the .reg file to include a \n it bombs out - infact when you edit these it uses a newline as a new value - so I am going to ASS-U-ME that I can simply split everything with \n Which is great because then you can just use StringSplit to get each element. Which I think is more user friendly than | and || which can be tricky to parse. Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/ Link to comment Share on other sites More sharing options...
Valik Posted February 7, 2004 Share Posted February 7, 2004 The API docs seem to say that \n is allowed with a value. But you can't do it from regedit, if you export a MULTI key and then manually edit the .reg file to include a \n it bombs out - infact when you edit these it uses a newline as a new value - so I am going to ASS-U-ME that I can simply split everything with \nWhich is great because then you can just use StringSplit to get each element. Which I think is more user friendly than | and || which can be tricky to parse.Good luck with that. I hope it works, but assuming with Microsoft is a very dangerous game... Link to comment Share on other sites More sharing options...
Somerset Posted February 7, 2004 Share Posted February 7, 2004 (edited) http://www.arcatapet.net/vb.cfmhttp://vb.softwarefolder.com/browse.php/Registry/20/hope those help someway these below are read and write.http://support.microsoft.com/?kbid=258528http://support.microsoft.com/?kbid=258545http://www.commedia.pt/ce/registry.html Edited February 7, 2004 by beerman 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