Topic "Commands before script?"

Author Message
Nozavi
[View user's profile]

Joined: 2016-06-13
Posts: 1
Location: Romania
Quote:
If both /script and /command parameters are used, commands from script file are executed first.

Hello,

Would it be possible to create a switch that makes winscp run the commands first and then the script?

I have a very long list of commands that I want to execute in just one go, so only using commands is out of the question and storing the user/password in plaintext in the script is again out of the question... the perfect solution would be to first login through the commands and then go through the long list of commands in the script...

Would that be possible? I'd really appreciate it

Thank you Exclamation
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
You can do it like:

winscp.net sftp://username:password@example.com/ /script=script.txt

Or even better, use environment variables in the script:

open sftp://%USER%:%PASS%@example.com/

See also https://winscp.net/eng/docs/guide_protecting_credentials_for_automation
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