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

martin

Re: Check File Existence With Winscp.exe

ansonee1 wrote:

I have found a ton of posts that instruct you how to check for the existence of a file, but every example I have found is for using WinSCP.com - I have yet to find an example that demonstrates how to use WinSCP.exe and how to check for a file with a mask.

Is there someplace I can find an example of this?

Your duplicate post:
https://winscp.net/forum/viewtopic.php?t=26959
ansonee1

Check File Existence With Winscp.exe

I have found a ton of posts that instruct you how to check for the existence of a file, but every example I have found is for using WinSCP.com - I have yet to find an example that demonstrates how to use WinSCP.exe and how to check for a file with a mask.

Is there someplace I can find an example of this?
thomasFrh

Re: Check file existence

Does anyone have an idea? I still tried a half day to find a way how to check whether the file exists... :(
thomasFrh

Check file existence

Hello all,

I try to find out how I can check whether a file exists. If the file not exists I want to send an email (-> backup script):

winscp.com /log=log.log /ini=nul /command ^ "option batch abort" ^ "open ftp://test:test@localhost/" ^ "option failonnomatch on" ^ "ls test.sql" ^ "exit"


if %ERRORLEVEL% neq 0 goto error

:error
echo No file found -> email
pause
exit 1

echo test


My question is how I have to change the script, because of course "ls" does not run... Unfortunately it is not possible to download the file, because the files are very big..

Maybe someone can help me!

Thanks,
Thomas