All of this actually works fine. We see the server start two WinSCP processes(WinSCP.com - 780kb and WinSCP.exe ~ 3750kb) WinSCP downloads the file, closes the processes again and moves the file. But once in a while the WinSCP.exe process ends up in a odd state where it only takes up around 1560kb and then hangs.
The process(es) can be restarted, the scheduled task can be restarted, but it keeps ending up with a WinSCP.exe process which only takes up ~1560kb and stops.
I've tried to enable logging of both the script and WinSCP, but it never comes to writing anything in the log file after the WinSCP.exe starts hanging.
The only solution so far has been to restart the whole server.
Has anyone experienced something like this before ?