Sign in to follow this  
Followers 0
Jon

Reg_multi_sz

8 posts in this topic

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?

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

What about a non-printing character of some sort and a @macro for easy access?

Share this post


Link to post
Share on other sites

#4 ·  Posted (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,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

Share this post


Link to post
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.

Share this post


Link to post
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...

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)


 

Spoiler

shoot_zpsfd329d66.png
dontbelieveeverythingyouthink_zps0e1e900

Madness is the first step to understanding...

Share this post


Link to post
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
Sign in to follow this  
Followers 0