Here is an example of how to automate the ftp.exe built-in tool:
The boot example, but the principle is the same (just use get instead of put ).
However, since these are just “piping commands” in ftp.exe, I recommend that you do not do this for production-quality batch files (without error handling, etc.), but use some kind of external tool instead. I gave this answer only because you explicitly asked for a solution that uses only the built-in Windows commands.
EDIT: Here's a concrete example:
REM replace this with your user name and password REM make sure there is no space between the pwd and the >> echo user me > getftp.dat echo mypass>> getftp.dat echo binary >> getftp.dat REM replace this with the remote dir (or remove, if not required) echo cd remoteSubDir >> getftp.dat REM replace this with the local dir echo lcd C:\Users\UserName\SomeLocalSubDir >> getftp.dat REM replace this with the file name echo get file.file >> getftp.dat echo quit >> getftp.dat REM replace this with the server name ftp -n -s:getftp.dat example.com del getftp.dat
Heinzi
source share