通过 VBscript 下载大文件

通过 VBscript 下载大文件

有人通过 VBScript 下载过大文件吗?我的脚本如下,下载超过 1GB 的文件时出错。小文件下载没有问题。我需要尝试其他方法吗?它给我的错误消息如下。提前感谢任何建议!

strFileURL = "http://10.0.0.0/File.zip"
strHDLocation = "C:\File.zip"


Set objXMLHTTP = CreateObject("MSXML2.ServerXMLHTTP")

objXMLHTTP.open "GET", strFileURL, false
objXMLHTTP.setTimeouts 1000 * 60 * 60, 1000 * 60 * 60, 1000 * 60 * 60, 1000 * 60 * 60
objXMLHTTP.send()

If objXMLHTTP.Status = 200 Then
  Set objADOStream = CreateObject("ADODB.Stream")
  objADOStream.Open
  objADOStream.Type = 1 'adTypeBinary

  objADOStream.Write objXMLHTTP.ResponseBody
  objADOStream.Position = 0    'Set the stream position to the start

  Set objFSO = Createobject("Scripting.FileSystemObject")
If objFSO.Fileexists(strHDLocation) Then objFSO.DeleteFile strHDLocation

  objADOStream.SaveToFile strHDLocation
  objADOStream.Close
  Set objADOStream = Nothing
End if

Set objXMLHTTP = Nothing
Set objFSO = Nothing

我收到的错误消息是:

Error: Not enough storage is available to complete this operation.
Code: 8007000E
Source: msxml3.dll

答案1

“错误:存储空间不足,无法完成此操作。”

您是否已检查确保确实有足够的磁盘空间来下载文件?

相关内容