Differences
This shows you the differences between the selected revisions of the page.
2005-05-04 | 2005-05-06 | ||
typography (martin) | 3.7.5 example comments (martin) | ||
Line 22: | Line 22: | ||
The example below connects to ''example.com'' server with account ''user'', downloads file and closes the session. Then it connects to the same server with account ''user2'' and upload the file back. | The example below connects to ''example.com'' server with account ''user'', downloads file and closes the session. Then it connects to the same server with account ''user2'' and upload the file back. | ||
<code winscp> | <code winscp> | ||
+ | # Automatically answer all prompts negativelly not to stall | ||
+ | # the script on errors | ||
option batch on | option batch on | ||
+ | # Disable overwrite confirmations that conflict with previous | ||
option confirm off | option confirm off | ||
+ | # Connect | ||
open user@example.com | open user@example.com | ||
+ | # Change remote directory | ||
cd /home/user | cd /home/user | ||
+ | # Force binary mode transfer | ||
option transfer binary | option transfer binary | ||
+ | # Download file to local directory d:\ | ||
get examplefile.txt d:\ | get examplefile.txt d:\ | ||
+ | # Disconnect | ||
close | close | ||
+ | # Connect as different user | ||
open user2@example.com | open user2@example.com | ||
+ | # Change remote directory | ||
cd /home/user2 | cd /home/user2 | ||
+ | # Upload file to current working directory | ||
put d:\examplefile.txt | put d:\examplefile.txt | ||
+ | # Disconnect | ||
close | close | ||
+ | # Exit WinSCP | ||
exit | exit | ||
</code> | </code> |