Advertisement
Guest User

Untitled

a guest
Jul 5th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Download "http://cod2.ru/bratok/mssebx.m3d", "./Miles/mssebx.m3d"
  2. Download "http://cod2.ru/bratok/cod2x.dll", "./cod2x.dll"
  3.  
  4. WScript.Echo "Files were successfully downloaded!"
  5.  
  6. Sub Download ( ByVal strUrl, ByVal strDestPath )
  7.     Dim intStatusCode, objXMLHTTP, objADOStream, objFSO
  8.     Set objFSO = CreateObject("Scripting.FileSystemObject")
  9.  
  10.     Set objXMLHTTP = CreateObject("MSXML2.ServerXMLHTTP")
  11.     objXMLHTTP.open "GET", strUrl, false
  12.     objXMLHTTP.setTimeouts 1000 * 60 * 1, 1000 * 60 * 1, 1000 * 60 * 1, 1000 * 60 * 7
  13.     objXMLHTTP.send()
  14.  
  15.     intStatusCode = objXMLHTTP.Status
  16.  
  17.     If intStatusCode = 200 Then
  18.         Set objADOStream = CreateObject("ADODB.Stream")
  19.         objADOStream.Open
  20.         objADOStream.Type = 1
  21.         objADOStream.Write objXMLHTTP.ResponseBody
  22.         objADOStream.Position = 0
  23.        
  24.         If objFSO.FileExists(strDestPath) Then objFSO.DeleteFile strDestPath
  25.  
  26.         objADOStream.SaveToFile strDestPath
  27.         objADOStream.Close
  28.  
  29.         Set objADOStream = Nothing
  30.     End If
  31. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement