Advertisement
stuppid_bot

Untitled

Aug 26th, 2014
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Dim links(2)
  2. links(0) = "http://cs14101.vk.me/c7007/v7007430/1eead/adfC1UWQgfI.jpg"
  3. links(1) = "http://cs14101.vk.me/c7007/v7007266/20a96/YHHQY-YPFt0.jpg"
  4. links(2) = "http://cs14101.vk.me/c7007/v7007266/20a7e/bf3gqbEQ8zo.jpg"
  5.  
  6. Dim folder
  7.  
  8. folder = SelectFolder(".")
  9.  
  10. Dim aux, aux1
  11.  
  12. For Each link In links
  13.     aux = Split(link, "?")
  14.     aux1 = Split(aux(0), "/")
  15.     Download link, folder & "/" & aux1( Ubound(aux1) )
  16. Next
  17.  
  18. WScript.Echo "Download has finished."
  19.  
  20. Sub Download(url, dst)
  21.     Dim http, stream
  22.  
  23.     Set http = CreateObject("microsoft.xmlhttp")
  24.     Set stream = CreateObject("adodb.stream")
  25.     http.Open "GET", url, False
  26.     http.Send
  27.  
  28.     With stream
  29.         .type = 1
  30.         .open
  31.         .write http.responseBody
  32.         .saveToFile dst, 2
  33.     End With
  34. End Sub
  35.  
  36. Function SelectFolder( myStartFolder )
  37. ' This function opens a "Select Folder" dialog and will
  38. ' return the fully qualified path of the selected folder
  39. '
  40. ' Argument:
  41. '     myStartFolder    [string]    the root folder where you can start browsing;
  42. '                                  if an empty string is used, browsing starts
  43. '                                  on the local computer
  44. '
  45. ' Returns:
  46. ' A string containing the fully qualified path of the selected folder
  47. '
  48. ' Written by Rob van der Woude
  49. ' http://www.robvanderwoude.com
  50.  
  51.     ' Standard housekeeping
  52.    Dim objFolder, objItem, objShell
  53.    
  54.     ' Custom error handling
  55.    On Error Resume Next
  56.     SelectFolder = vbNull
  57.  
  58.     ' Create a dialog object
  59.    Set objShell  = CreateObject( "Shell.Application" )
  60.     Set objFolder = objShell.BrowseForFolder( 0, "Select Folder", 0, myStartFolder )
  61.  
  62.     ' Return the path of the selected folder
  63.    If IsObject( objfolder ) Then SelectFolder = objFolder.Self.Path
  64.  
  65.     ' Standard housekeeping
  66.    Set objFolder = Nothing
  67.     Set objshell  = Nothing
  68.     On Error Goto 0
  69. End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement