Differences
This shows you the differences between the selected revisions of the page.
2013-07-29 | 2013-07-29 | ||
added explicit protocol to session url (martin) | no not even mention a possibility to open a session from commandline (martin) | ||
Line 150: | Line 150: | ||
exit | exit | ||
</code> | </code> | ||
- | Save the script to the file ''example.txt''. To execute the script file use the following command. As the script connects the session itself, using the command ''open'', omit the ''session'' command-line parameter. | + | Save the script to the file ''example.txt''. To execute the script file use the following command. |
<code> | <code> | ||
winscp.exe /console /script=example.txt | winscp.exe /console /script=example.txt | ||
Line 158: | Line 158: | ||
<code> | <code> | ||
winscp.exe /console /command "option batch abort" "open sftp://user@example.com" "get examplefile.txt d:\" "exit" | winscp.exe /console /command "option batch abort" "open sftp://user@example.com" "get examplefile.txt d:\" "exit" | ||
- | </code> | ||
- | |||
- | Instead of using ''open'' command you can also open a session using a [[commandline|command-line parameter]]. Note that in that case session is opened yet before script starts. Particularly ''option'' commands do not apply yet. Generally you should avoid using this method. | ||
- | <code> | ||
- | winscp.exe /console /script=example.txt user@example.com | ||
</code> | </code> | ||