2
votes

I need to download a file from my company's FTP server daily, I tried to do this via batch

open wget --user=USERNAME --password=PASSWORD FTP://000.00.0.0 
cd/company/file 
get *.* forfiles /D+0
put C:\loads\path 
pause

I tried some alternatives seen in the WinSCP documentation, but I was not successful.

1

1 Answers

2
votes

To download files from an FTP server using WinSCP from a batch file, you can do:

"C:\Program Files (x86)\WinSCP\WinSCP.com" /log=winscp.log /ini=nul /command ^
    "open ftp://username:[email protected]/ ^
    "cd /company/file" ^
    "get *.*" ^
    "put C:\loads\path\*" ^
    "exit"

pause

See https://winscp.net/eng/docs/guide_automation.

Also WinSCP GUI can generate a FTP download batch file template for you.