'Using FTP.exe and mget to download files and directories from an FTP directory

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)

prompt
open ftp://xx.xx.xx.xx
myuser
mypassword
lcd C:\localdir
cd /remotedir/
mget *
quit

The problem is that this does not get everything in the specified directory. Only the loose files in the directory such as a .zip or .txt file. I have searched the questions here to no avail. So how can I get mget to not only download loose files in the root directory but also download the sub-directories and containing files (keeping the structure intact)?



Solution 1:[1]

Just answering this in case anyone else has a similar issue. The ftp.exe was a bust but I found out it is fairly easy using WinSCP just create a scheduled task in task scheduler and use the options section for command line parameters

Instructions for creating download script with WinSCP:
http://winscp.net/eng/docs/guide_automation

Instructions for scheduling WinSCP transfer task:
http://winscp.net/eng/docs/guide_schedule

WinSCP downloads directories recursively by default.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Martin Prikryl