Jump to content

Reg_multi_sz


Jon
 Share

Recommended Posts

  • Administrators

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?

Link to comment
Share on other sites

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

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,ff

Would 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!!!! :whistle:

Edited by Bartokv
Link to comment
Share on other sites

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 :whistle:B)

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

  • Administrators

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.

Link to comment
Share on other sites

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.

Good luck with that. I hope it works, but assuming with Microsoft is a very dangerous game...
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...