Topic "Use opened session with different scripts"

Author Message
Nephtis

Guest


Hi,

I'm facing some problem to use an opened session on an unix server. We use a securID so the password changes every minute.

How is it possible to run several scripts for the same session but not at the same time?


For exemple :

Batch file :
Test_sending.bat
WinScp.exe MyUnixServer /console /command /script=C:\Test\send_file_1.txt

Scripts files :
send_file_1.txt :
option transfer binary
put C:\Test\my_file_1.txt /home/test/my_file_1.txt

send_file_2.txt :
option transfer binary
put C:\Test\my_file_2.txt /home/test/my_file_2.txt

Batch file is run (enters for the first time the password) and some minutes later we have to run the second script file. How to use the first session opened?
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
You have to merge the scripts into one and make the script pause somehow between the two phases.
You can try something like "call sleep 5m" (if you use SFTP/SCP).
See http://winscp.net/eng/docs/scriptcommand_call
Guest




Thanks for your answer but the problem is that I don't know the script to play in advance.
The scripts are generated dynamically by the actions of the users on another application.

I see the first WinScp session in the taskbar (if I don't use exit on my script), isn't it possible to call this session?

Something like WinScp.exe /useAlreadyOpenedConnexion 1 /console /command /script=C:\Test\next_command.txt
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
No it's not possible.

For dynamic tasks like this use WinSCP .NET assembly:
http://winscp.net/eng/docs/library
_________________
Martin Prikryl
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