Create multi string regkey

(imported topic written by efin91)

I am uninstalling and re-installing a program but need to keep the data that exists in a multi string regkey and re-create that key after re-installing. This is on over 100 machines and the values are different

I am able to get the value from the key using the below command but I am unable to re-create a REG_MULTI_SZ key

appendfile {substrings separated by “%00” whose (it != “”) of (value “Exclude” of key “{location of key}” of registry as string)}

This will get an output of something like this:

C:\Program Files\sample1*.sample%00 C:\Program Files\sample2*.sample%00 C:\Program Files\sample3*.sample%00

Can anyone suggest how to recreate this?

This doesn’t work, not sure how to tell bfix it’s a multi string

regset “{location of key}” “Exclude”=C:\Program Files\sample1*.sample%00 C:\Program Files\sample2*.sample%00 C:\Program Files\sample3*.sample%00

Thanks

(imported comment written by BenKus)

efin,

See this thread:

http://forum.bigfix.com/viewtopic.php?id=1045

Ben

(imported comment written by kebulm91)

Can anyone answser how to ‘create’ a REG_MULTI_SZ value using regset in action script? I can read one fine based on the above thread but I need to know how to create one.

Thanks,

Ken

(imported comment written by jessewk)

You should create a .reg file and import it through regedit.

There’s an example here: http://forum.bigfix.com/viewtopic.php?id=2470

(imported comment written by kebulm91)

That doesn’t seem to help… to create a reg file that can be imported the entry has to be in hex for a reg_multi_sz value.

I found that regset will work if you include hex(7): as the beginning string of the values but the data still has to converted to hex and delimited with '00’s

Any idea how you can convert the following hex data into a string that is comma delimited using relevance?

646174613100646174613200646174613300

into this:

64,61,74,61,31,00,64,61,74,61,32,00,64,61,74,61,33,00

I can then use the following action script command to set the values into the registry:

regset “[HKEY_LOCAL_MACHINE\Software\TEST]” “test”=hex(7):64,61,74,61,31,00,64,61,74,61,32,00,64,61,74,61,33,00

The ‘test’ value is created with the items:

data1

data2

data3

Anyone know how to make that type of string manipulation using relevance?

Ken

(imported comment written by jessewk)

Here you go:

Q: concatenation “,” of (if length of it >= 2 then firsts 2 of it else it) of (it & following text of it) of characters whose (start of it mod 2 = 0) of “646174613100646174613200646174613300”

A: 64,61,74,61,31,00,64,61,74,61,32,00,64,61,74,61,33,00

(imported comment written by kebulm91)

awesome - thanks.