scripting - How to ignore failure when file does exist when downloading with WinSCP script -


running script file sftp server, recurring job , should still succeed if no file exist, there option can specify?

option batch on option confirm off option transfer binary open sftp://server -timeout=60 password /file/2_04-28-2015.txt  d:\files close exit 

getting result:

can't attributes of file 'file/2_04-28-2015.txt'.     no such file or directory.     error code: 2 

tried setting failonnomatch:

winscp> option failonnomatch on unknown option 'failonnomatch'. 

you cannot tell winscp ignore absent, file when using specific file name.

but can check file existence prior actual download.


easy alternative hack use file mask (note trailing *) , set failonnomatch off:

option failonnomatch off /file/2_04-28-2015.txt*  d:\files\