Session.PutFiles failed to transfer a file, how can I make WinSCP go back and try to recopy it
Hi all,
I am transferring a lot of files via WinSCP and randomly one will fail, it happens, no big deal, but is there a way I can have WinSCP go back to that file and try to copy it again?
The error I am getting is
Here is the majority of the code, should be enough to see what is going on the path for
Any suggestions on how to have it go back and copy the one file it missed?
Thanks all!
I am transferring a lot of files via WinSCP and randomly one will fail, it happens, no big deal, but is there a way I can have WinSCP go back to that file and try to copy it again?
The error I am getting is
This occurs during an update process to where several apps are being updated one by one in order, and it happens in the middle of the process.The process cannot access the file because it is being used by another process
Here is the majority of the code, should be enough to see what is going on the path for
$updateFolder
is correct as there are say 1000 files in that path, and the random one will be missed from time to time (it is not often at all, but I am try to deal with the error handling).
Add-Type -Path "path to WinSCPnet.dll" $sessionOptions = New-Object WinSCP.SessionOptions $sessionOptions.ParseUrl("ftp://${username}:$password@$url") $session = New-Object WinSCP.Session $session.Open($sessionOptions) $session.PutFiles($updateFolder, "update path").Check()
Thanks all!