I've been scouring for a day or two now and am having some difficulty coming up with a good method to tackle a problem I have. I need to write a registry value in binary, which in itself is no problem. The value that I need to write needs to be converted from a string value - also not a big deal, but I need to manipulate this string in order for it to be properly formatted and that's where I'm stuck.
$file = "filename.iso"
$path = ";C:\Documents and Settings\All Users\Application Data\Program\"&$file
For $i = 0 to UBound($path)-1
$value+=$path[$i]+Chr(0)
Next
RegWrite("HKEY_CURRENT_USER\Software\Program\Preferences\VirtualCD","VirtualCDDriveList","REG_BINARY", "0x"&Hex(StringtoBinary($value)))
So basically I'm needing to take the path and filename string, insert a null character in between every character, then convert it to hex value to write into the registry...
The problem thus far has been in dealing with the existing white space. I'm having difficulty properly converting this to hex and spacing it with nulls while not losing the spacing that exists due to the long path name.
Any help in conquering this problem would be most appreciated!