title: Using FTP.exe and mget to download files and directories from an FTP directory
body: <p>I am trying to set up an automatic download of the files from a FTP directory on a scheduled basis. The solution I have come up with is to create a batch file that will be ran by windows task scheduler. The batch file is as follows (so far)</p>
  
  <pre><code>prompt
  open ftp://xx.xx.xx.xx
  myuser
  mypassword
  lcd C:\localdir
  cd /remotedir/
  mget *
  quit
  </code></pre>
  
  <p>The problem is that this does not get everything in the specified directory. Only the loose files in the directory such as a <code>.zip</code> or <code>.txt</code> file. I have searched the questions here to no avail. So how can I get <code>mget</code> to not only download loose files in the root directory but also download the sub-directories and containing files (keeping the structure intact)?</p>