Re: temp files from remote
It looks like you are looking for Keep temporary copies of remote files in deterministic paths option:
https://winscp.net/eng/docs/ui_pref_storage
But as you have posted this to the Scripting forum, I'm not sure.
https://winscp.net/eng/docs/ui_pref_storage
But as you have posted this to the Scripting forum, I'm not sure.