Differences

This shows you the differences between the selected revisions of the page.

2015-12-16 2015-12-17
removing recent tags with release of the next major branch 5.8 (martin) removing uses of option batch and confirm not needed since 5.6 with release of the next major branch 5.8 (martin)
Line 157: Line 157:
In the example below, WinSCP connects to ''example.com'' server with account ''user'', downloads file and closes the session. Then it connects to the same server with the account ''user2'' and uploads the file back. In the example below, WinSCP connects to ''example.com'' server with account ''user'', downloads file and closes the session. Then it connects to the same server with the account ''user2'' and uploads the file back.
<code winscp> <code winscp>
-# Automatically abort script on errors 
-option batch abort 
-# Disable overwrite confirmations that conflict with the previous 
-option confirm off 
# Connect # Connect
open sftp://user:password@example.com/ -hostkey="ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx" open sftp://user:password@example.com/ -hostkey="ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"
Line 189: Line 185:
For simple scripts you can specify all the commands on [[commandline|command-line]] using ''/command'' switch: For simple scripts you can specify all the commands on [[commandline|command-line]] using ''/command'' switch:
<code batch> <code batch>
-winscp.com /command "option batch abort" "open sftp://user:password@example.com/ -hostkey=""ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx""" "get examplefile.txt d:\" "exit"+winscp.com /command "open sftp://user:password@example.com/ -hostkey=""ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx""" "get examplefile.txt d:\" "exit"
</code> </code>
Line 196: Line 192:
<code batch> <code batch>
winscp.com /command ^ winscp.com /command ^
-    "option batch abort" ^ 
    "open sftp://user:password@example.com/ -hostkey=""ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx""" ^     "open sftp://user:password@example.com/ -hostkey=""ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx""" ^
    "get examplefile.txt d:\" ^     "get examplefile.txt d:\" ^

Last modified: by martin