Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

JanneFiH

Automated download but skip existing files

Hi,
I apologize if this topic has been added before, but I tried finding any other thread with the same problem as me, but failed.
I'm trying to connect through FTP and download an entire library, but skip already existing files. The problem is that it overwrites them instead.

Can anyone be so kind to point out the error I'm doing?

@echo off


"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
  /log="F:\log\WinSCP.log" /ini=nul ^
  /command ^
    "open ftp://user:password@ip:21/ -passive=0" ^
    "cd /Docs" ^
    "lcd Z:\Docs" ^
    "get *" ^
    "exit"

set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0 (
  echo Success
) else (
  echo Error
)

exit /b %WINSCP_RESULT%


Thank you in advance!

Janne