Topic "Sftp script error - "invalid session number""

Author Message


I have saved sessions in Winscp (sftp port 22 with user name and password (no private key) )
and I can connect them via winscp gui with no problam.
When I call them using this following script

open AAA
option confirm off

get / *. csv C: \ WinscpFiles \ Accounts \ AAA \

Close AAA

I get
starting the session...
reading remote directory...
session started.
Active session: [1] AAA
confirm off
invalid session number 'AAA'

please advice
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24736
Location: Prague, Czechia
The close command accepts a sequence number of the session (would be "1" in your case), not a name of opened site.

But I rather see a problem with your put command, as it seems no files are uploaded. Do you indeed have all the spaces in the paths there in your script? As it does not look plausible this can work.
Martin Prikryl

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!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License