Post a reply

Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)


Topic review


[RESOLVED] Re: Automation script - error 9 Invalid handle

Hi Martin
Thank you for quick answer. Yes this was the clue.

Re: Automation script - error 9 Invalid handle

You have a wrong slash in your destination path. SFTP (and WinSCP) use forward slashes. It should be:
put -delete Document_name_*.* -resumesupport=off ./

You can actually omit the target parameter for the same effect:
put -delete Document_name_*.* -resumesupport=off

Also, use the latest version of WinSCP.

Automation script - error 9 Invalid handle

I created script to automatically upload files to remote sftp server. But there is a problem with sending the files because script returns error 9 - invalid handle.

Version I have tested:
Winscp Portable - 5.9.3 Build 7136
Winscp Automation - 5.17.9 Build 10905

Manual via GUI works fine
When login to sftp server with gui I can upload files manually. Only script return such error.

Scripting language checked
I have checked batch script and powershell. Both fails with the same code.

Other servers
This script are used to connect to other servers and works fine. So I can suspect that remote sftp servers has got some settings disallowing scripting or terminal acctions. But I am not sure.

Other information
Administrator of remote servers says that everything is ok from his side.
I asked to delete all files from directory (even hidden one) because I thought that problem can be with unfinished transfer in one previous session but it not resolved the problem.

File with detailed (debug level 2) log has been attached.

Could you help me with this problem or can you give me some clues haw I can debug it?