2

I want to make a batch file to copy files from an FTP server (external) to a network drive.

I am not sure which command to use.

That will be for a batch file on Windows 10

Many thanks.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992

1 Answers1

2

Use Windows ftp.exe:

ftp -s:download.txt

Where the download.txt may look like:

open ftp.example.com
username
password
get /remote/path/file.txt \\localserver\share\path\file.txt
bye

Though Windows ftp.exe does not support passive mode FTP, what makes it useless nowadays in lot of scenarios due to ubiquitous firewalls and NATs.

If you face a problem with this, you will have to use a 3rd party FTP client (see How to use passive FTP mode in Windows command prompt?) or some more powerful scripting language than a batch file (e.g. PowerShell).

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992