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

sergio77

Command line and Exit Code 1

Hi all,

this is my first post in this forum (so don't kill me please) :-)

This is the question:

I prepared a simple scheduled task to download some files from ad FTPS Server.

This is the code:
...
echo open ftp://XXXXX:YYYYY@10.10.10.10:990 -explicittls -certificate="......"> auto.txt
echo get file1.txt %HOME%\file1.txt>> auto.txt
echo get file2.txt %HOME%\file2.txt>> auto.txt
echo get file3.txt %HOME%\file3.txt>> auto.txt
echo quit>> auto.txt
winscp.exe /script=auto.txt /log=ftps.log
...
Script is working fine (if all 3 files exist), if (for example) file2.txt doesn't exist script stop with an error (Exit Code 1) and it doesn't try to download file3.txt....

This is the LOG:

2016-09-06 12.26.17.525 Listing file "file2.txt".
2016-09-06 12.26.17.525 Recupero informazioni file in corso...
2016-09-06 12.26.17.525 MLST file2.txt
2016-09-06 12.26.17.556 550 File or directory not found.
2016-09-06 12.26.17.556 Impossibile recuperare informazioni sul file
2016-09-06 12.26.17.556 Script: Impossibile ottenere attributi del file 'destinazioni.txt'.
2016-09-06 12.26.17.556 Script: Impossibile recuperare informazioni sul file
2016-09-06 12.26.17.556 File or directory not found.
2016-09-06 12.26.17.556 Script: Failed
2016-09-06 12.26.17.556 Script: Exit code: 1
2016-09-06 12.26.17.556 Disconnessione dal server

How can I fix this error?

Thanks
Sergio