title: Download multiple files from an FTP using VBScript
body: <p>I'm not at all an expert at VB Scripting, but since it's a requirement at one of my projects for the moment, I am trying to write a VBScript that will GET all files from a specified FTP Folder.</p>
  
  <p>I manage to get a single specified file, but I can't seem to get all files in a folder. Here's the script I'm trying to use:</p>
  
  <pre><code>    Dim objOutStream
    Const OpenAsDefault = -2
    Const FailIfNotExist = 0
    Const ForReading = 1
    Const ForWriting = 2
  Set objFSO = CreateObject("Scripting.FileSystemObject")
  Set objOutStream = objFSO.OpenTextFile("C:\temp\temp\empty.txt", ForWriting, True, TristateFalse)
  With objOutStream
      .WriteLine "USER myuser"   ' USERNAME
      .WriteLine "mypass"     ' Password
      .WriteLine "binary"
      .WriteLine "prompt n"
      .WriteLine "lcd /foldertocopyfrom" ' FOLDER I'm changing into
      .WriteLine "mget *"    ' Get all files with today's date in it
      .WriteLine "bye"
      .Close
  End With
  
  Set oFTPScriptShell = CreateObject("WScript.Shell")
  oFTPScriptShell.Run "%comspec% /c FTP -n -s:" &amp; "C:\temp\temp\empty.txt" &amp; " " &amp; "ftp.location.com", 0, True
  </code></pre>
  
  <p>It doesn't give me an error or anything, it basically does nothing (and yes, I'm sure there are files in the /foldertocopy from :-))</p>
  
  <p>Any ideas? Something obvious I am missing?</p>
  
  <p>Thanks!</p>