I cannot imagine how this script might delete the file. The problem must be different/elsewhere. What else did you to to debug the issue? Did try adding some debugging code to check at what point does the file disappear?
If you want us to check anyway, please attach session logs of both sessions.
Please attach a full session log file showing the problem (using the latest version of WinSCP).
To generate the session log file, set Session.SessionLogPath
. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.