解決VB6直接用FILELEN無法擷取超過2G大小的檔案
方法一:
Dim fso
Set fso = CreateObject(“Scripting.FileSystemObject”)
a1 = fso.GetFile(“D:\銳起無盤4\server1\Virtual Hard Disks\server2012銳起4.vhdx”).Size
MsgBox a1
方法二:
引用 Microsoft Scripting Runtime
'利用FSO對象獲得大檔案的大小 需引用 Microsoft Scripting Runtime
Function GetFlen(ByVal FpathName As String) As Double
Dim fso As New FileSystemObject
GetFlen = fso.GetFile(FpathName).Size
End Function