Automation script - error 9 Invalid handle

Advertisement

noel137
Guest

Automation script - error 9 Invalid handle

Hi,
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.

Log
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?

Reply with quote

Advertisement

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

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.

Reply with quote

noel137
Guest

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

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

Reply with quote

Advertisement

You can post new topics in this forum