Scripting: File transfer fails with "The file exists." [resolved]

Advertisement

Thiemo
Joined:
Posts:
2
Location:
In front of my screen

Scripting: File transfer fails with "The file exists." [resolved]

Hi all,

I script WinSCP with PowerShell and repeatedly but not consistently run into the problem, that after an apparently successful transfer the script fails with "The file exists."

We use the following and cannot update to newer versions:
WinSCP 5.5.1 build 3970
Windows Server 2008 R2 Enterprise Service Pack 1
SCP

I attached script and log file. Is there a possibility to get additional information about the failure?

Kind regards

Thiemo
Last edited by Thiemo on 2015-11-13 08:42; edited 1 time in total
Description: Script and log file

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: Scripting: File transfer fails with "The file exists."

The "The file exists" is not WinSCP error. I do not even see it in your code. Where does it come from?

Reply with quote

Thiemo
Joined:
Posts:
2
Location:
In front of my screen

Re: Scripting: File transfer fails with "The file exists." [resolved]

martin wrote:

The "The file exists" is not WinSCP error. I do not even see it in your code. Where does it come from?

If the error is not from WinSCP it must be an internal PowerShell error of the Move-Item command. After the SCP transfer the files get moved from a intermediary directory to the final one. I case a file was transferred already once before and an application puts a write lock on it, the move should fail. I tried that artificially and received a similar error message but not the very same.

Thanks for the confirmation that the error is not one of WinSCP. :)

Reply with quote

Advertisement

You can post new topics in this forum