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

Author Message
Thiemo
[View user's profile]

Joined: 2015-11-12
Posts: 2
Location: In front of my screen
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
winscp_case.zip (86.26 KB) [Download]

Description: Script and log file

martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
The "The file exists" is not WinSCP error. I do not even see it in your code. Where does it come from?
Thiemo
[View user's profile]

Joined: 2015-11-12
Posts: 2
Location: In front of my screen
prikryl 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. Smile
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License