I want to manually create a binary script and then save it as binary file.
I want to append all of the following bytes and create a binary file out of them.
&HF0
&HF1
&HF2
I want to able to do something like this :
Dim generateData(3) As Byte
generateData(0) = &HFF
generateData(1) = &HFE
generateData(2) = &HFC
But obviously As Byte doesn't work on Vbscript. I do use the following function to write binary array to disk (at least I'll when I able to create a binary array)
Function SaveBinaryData(FileName, ByteArray)
Const adTypeBinary = 1
Const adSaveCreateOverWrite = 2
'Create Stream object
Dim BinaryStream
Set BinaryStream = CreateObject("ADODB.Stream")
'Specify stream type - we want To save binary data.
BinaryStream.Type = adTypeBinary
'Open the stream And write binary data To the object
BinaryStream.Open
BinaryStream.Write ByteArray
'Save binary data To disk
BinaryStream.SaveToFile FileName, adSaveCreateOverWrite
End Function