Copy folders through FTP in Windows

16,196

Windows command-line FTP client, the ftp.exe, does not support recursive directory transfers.


You have to use a 3rd party FTP client for that.

For example with WinSCP FTP client, you can use a batch-file like:

winscp.com /command ^
    "open ftp://user:[email protected]/" ^
    "get /folder/* c:\target\" ^
    "exit"

It will automatically download all files and subfolders in the /folder.

For details, see WinSCP guide to automating file transfers from FTP server. There's also a guide for converting Windows ftp.exe script to WinSCP.

(I'm the author of WinSCP)

Share:
16,196
Vishal5364
Author by

Vishal5364

Updated on June 18, 2022

Comments

  • Vishal5364
    Vishal5364 almost 2 years

    I have a Windows 2012 server where I am trying to copy a folder through FTP. The folder contains multiple folders inside it and the size is around 12 GB. What command can be used to copy the whole tree structure including all the folders and files inside it.

    • I cannot zip this folder.
    • Also I have tried using mget* but it copies all files from all the folders but doesn't created folder structure.
    • I am unable to use TAR command as the prompt shows "invalid command".