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: Delete Local Files or Return Error Code on Connection failed

KennethW wrote:

Hello - I have a similar issue where I either would like to have WinSCP return an error code on connection failed (it currently returns zero)

Are you using the latest version of WinSCP. The latest version should return 1 on any error.
KennethW

Delete Local Files or Return Error Code on Connection failed

Hello - I have a similar issue where I either would like to have WinSCP return an error code on connection failed (it currently returns zero) or be able to delete local files from within WinSCP script after putting successfully to the remote server. I am calling the WinSCP command line version from a batch file using a WINSCP script.

Is this possible ?

Thanks,
KennethW
Guest

I may have just found the answered to my question, but would like confirmation.

On https://winscp.net/eng/docs/faq_delete_synchronized_files it says "..to generate script to delete the source copies" The way this sounds, WinSCP cannot delete these files on its own.

Thanks!!!
Guest

prikryl ... I'm not seeing a delete option on the link you gave.

My situation is a little different than nbr_uk's. I'm needing to delete local files after being moved to a remote destination.
In the synchronize dialog box I have:
Direction = Remote
Mode = Synchronize Files
Options = Delete Files, Preview Changes
Comparison Criteria = Modification Time

How do I get the local files to be deleted once moved?

Thanks!!!
nbr_uk

Delete files on automatic syncronization?

Hi all, I've automated syncronization using information I found in his thread https://winscp.net/forum/viewtopic.php?t=4181 (thanks Prikryl) and it works a treat - I just need to adjust my script to delete files from the local directory when they no longer exist in the remote directory. It currently reads as follows:

open stored_session
synchronize local [local docs] [docs on server]

Is there a switch I can add to facilitate this? Hope someone can help.

Thanks, nbr_uk