I need some help writing a script that would download any files from a remote dir and after download, delete them from remote dir. I know how to download and delete a remote file via script. The problem is that I only want to delete those files that have been downloaded successfully. If I was writing a unix shell script I know, I would read the list of files in a given dir, then using a foreach type loop, download each file at a time and then delete it if download was successful. I looked into synchronize command but that's not what I want to do. How can I accomplish this via WinSCP script. I would schedule this script using Windows Scheduler.