If I have two variables containing binary values, how do I append them together as one binary value? For example, if I used WMI to read the registry of two REG_BINARY value, I then want to be able to concatenate the values.
VBScript complains of a type mismatch when you try to join with the ‘&’ operator.
For the record, I wanted VBScript code for a large userbase as a logon script that has the least chance of failing. I like the ADO objects, but there are so many mysterious ways ADO can be broken, so I shy away from ADODB.Stream.
Instead, I was able to write conversion code to convert binary to hex encoded strings. Then, to write back to a
REG_BINARYvalue, I convert it to an array of integers and give it to theSetBinaryValueWMI method.Note:
WshShellcan only handleREG_BINARYvalues containing 4 bytes, so it’s unusable.Thank you for the feedback.