- Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathFileToBinary.vbs
More file actions
Latest commit
18 lines (16 loc) · 438 Bytes
/
Copy pathFileToBinary.vbs
File metadata and controls
18 lines (16 loc) · 438 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
'
' Create a Binary buffer (byte array / VT_ARRAY|VT_UI1) from a file path,
' using only components included with Windows.
'
' Dependencies:
' - Microsoft ActiveX Data Objects ("ADODB.Stream")
'
Option Explicit
FunctionFileToBinary(Filepath)
DimStream
SetStream=CreateObject("ADODB.Stream")
Stream.Type=1' adTypeBinary
Stream.Open
Stream.LoadFromFileFilepath
FileToBinary=Stream.Read()
EndFunction