- Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathFileToStream.vbs
More file actions
Latest commit
23 lines (21 loc) · 750 Bytes
/
Copy pathFileToStream.vbs
File metadata and controls
23 lines (21 loc) · 750 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
'
' Wraps an existing file in a stream object to access it as an
' IStream/ISequentialStream object.
'
' This function requires the Microsoft Windows Image Mastering API v2.0
' (IMAPIv2), included in Windows Vista, 2008 and later, and installable on
' XP and 2003.
' It is much more efficient than using the ADODB.Stream object that many
' developers use for this purpose because it wraps the file in a stream from
' its original storage instead of loading it all into RAM.
'
' Dependencies:
' - Microsoft Windows Image Mastering API v2.0 (IMAPIv2)
'
Option Explicit
FunctionFileToStream(Path)
DimIIM
SetIIM=CreateObject("IMAPI2FS.MsftIsoImageManager")
IIM.SetPathPath
SetFileToStream=IIM.Stream
EndFunction