Page 1 of 1 1
Topic Options
#206667 - 2013-02-09 03:47 PM writevalue() reg_multi_sz broken?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
I had to modify a service dependency, which is a multistring registry type.
did a simple:
 Code:
if not instr(readvalue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\BITS","dependonservice"),"wohoo")
 $=writevalue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\BITS","dependonservice",readvalue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\BITS","dependonservice")+"|wohoo","REG_MULTI_SZ")
endif

after applying this to "few" computers, I was suprised to find that the resulting string was:
RpcSs
EventSystem|wohoo

instead of:
RpcSs
EventSystem
wohoo

to note, no, I didn't use wohoo and no I didn't modify BITS.
First I thought my syntax was wrong but then the manual even has an example:
 Code:
WriteValue("EZReg\Test", "A MultiString variable", "Line 1|Line 2|Line 3 with a || in it|", "REG_MULTI_SZ")

If @ERROR = 0

   ? "Value written to the registry"

Endif

so, this a bug or what???
_________________________
!

download KiXnet

Top
#206668 - 2013-02-09 04:42 PM Re: writevalue() broken? [Re: Lonkero]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4400
Loc: New Jersey
Does the ReadValue return a string with a "|" at the end? If so, it will double, resulting in the pipe being a literal.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#206670 - 2013-02-09 04:49 PM Re: writevalue() broken? [Re: Lonkero]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
Try replacing the |'s with Chr(124) and see if that works.
Top
#206673 - 2013-02-09 05:14 PM Re: writevalue() broken? [Re: ShaneEP]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
damn...
Glenn, I think you have the correct answer.
need to download kix and try it out, but honestly think that's the obvious cause...
_________________________
!

download KiXnet

Top
#206674 - 2013-02-09 05:18 PM Re: writevalue() broken? [Re: Lonkero]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
yeap, that's it. thanks!
_________________________
!

download KiXnet

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 323 anonymous users online.
Newest Members
Audio, Hoschi, Comet, rrosell, PatrickPinto
17880 Registered Users

Generated in 0.051 seconds in which 0.022 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org