Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

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

TVB_FSU

Re: A way to distinguish errors?

Awesome ... Thanks so much!
martin

Re: A way to distinguish errors?

Not in script, in your batch file that runs WinSCP to run the script.

Something like:

if not exist yourfile.cvs exit

winscp.exe /script=script.txt
TVB_FSU

Re: A way to distinguish errors?

martin wrote:

What about not running the script if the files do not exist?


Thanks Prikryl ... Can you point me to where I can learn how to write that into the script. I have experience with php and database scripting with if/else, but not this type.

Thanks again for the response!

Trish
martin

Re: A way to distinguish errors?

What about not running the script if the files do not exist?
TVB_FSU

A way to distinguish errors?

Hello! First of all, let me say I "inherited" this task, and it's not exactly more area of expertise, so if I ask stupid questions, please bear with me! I searched documentation and FAQs and can't find the answer to this...

We have a database that exports two .csv files that we upload to another area of campus. There are times when there are no files to export/upload.

At the end of the script is:

echo Success!
"C:\Program Files\WinSCP\email_success.vbs"
goto end

:error
echo Error!
"C:\Program Files\WinSCP\email_error.vbs"

My question is this: If there is no file to send, can it not be considered an error? The script runs every 30 minutes with scheduler, so there are many times there just isn't anything to upload.

Thanks in advance for your assistance!

Trish