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

martin

dammyware wrote:

Is any way to include the return code (0 or 1) so i can execute conditionally the move command when i run the batch file?

WinSCP does return 0/1 exit code to indicate its result. As the FAQ linked in my previous post shows. You still didn't show us what are you doing to process the exit code.
dammyware

Hello Martin, thanks for your reply.

I use a batch file with the following command:

move C:\sync\folder\*.* C:\archive\folder.

This batch is excecuted conditionally with windows scheduler with the following xml code:

<QueryList>
<Query Id="0" Path="Microsoft-Windows-TaskScheduler/Operational">
<Select Path="Microsoft-Windows-TaskScheduler/Operational">*[EventData[@Name='TaskSuccessEvent'][Data[@Name='TaskName']='\Taskname']]</Select>
</Query>
</QueryList>

Is any way to include the return code (0 or 1) so i can execute conditionally the move command when i run the batch file?
martin

Re: What if last sync is not succesfull?

You didn't shown us anything about how you move the files to the archive. So we cannot really answer your question.
Anyway, see https://winscp.net/eng/docs/faq_script_result
dammyware

What if last sync is not succesfull?

I have an automated proccess using windows schedulers running in 3 steps

1. Export files from Software
2. Transfer those files to a given FTP
3. Move those files to archive so that they don't sync again based on if the transfer scheduler is successful. This is done so that the files in the destination are moved to another folder which i don't have access and i really don't want to even think what will happen if i sync those files again.

Now all of the above works flowless except from one condition. Client internet connection is not good due to it's server location and sometimes disconnect before file transfer so files are moved to archive and will not sync again. I thought that using an XML on the archive scheduler to run only if the previous scheduler is sucessful was going to work but obviously scheduler does not know the result of winscp.

Is there any other work arround in an automated way? Even if it means changes in the stracture of this process