Differences
This shows you the differences between the selected revisions of the page.
| 2010-11-22 | 2011-02-08 | ||
| Restored revision 1263976149. Undoing revision 1290419472. (martin) (hidden) | no summary (58.26.83.200) (hidden) | ||
| Line 6: | Line 6: | ||
| &screenshotpict(scripting) | &screenshotpict(scripting) | ||
| - | ===== Using Scripting ===== | ||
| - | See [[commandline|command-line parameters]] to learn how to enter the console/scripting mode. | ||
| - | For automation, commands can be read from a script file specified by ''/script'' switch, from standard input or passed from the command-line using the ''/command'' switch. | + | # Automatically answer all prompts negatively not to stall |
| - | + | # the script on errors | |
| - | By default an interactive mode is used (the user is prompted in the same way as in GUI mode). To switch to a batch mode (all prompts are automatically answered negatively) use the command ''[[script_commands#option|option batch on]]''. For the batch mode it is recommended to turn off confirmations using ''[[script_commands#option|option confirm off]]'' to allow overwrites (otherwise the overwrite confirmation prompt would be answered negatively, making overwrites impossible). | + | option batch on |
| - | + | # Disable overwrite confirmations that conflict with the previous | |
| - | Multiple sessions can be opened simultaneously. Use the ''[[script_commands#session|session]]'' command to switch between them. | + | option confirm off |
| - | + | # Connect using a password | |
| - | Note that the first connection to an SSH server requires [[scripting#hostkey|verification of the host key]]. | + | # open user:password@example.com |
| - | Also the first connection to FTPS host with [[ftps#certificate|certificate]] signed by untrusted authority requires verification of the certificate. | + | # Connect |
| + | open user@example.com | ||
| + | # Change remote directory | ||
| + | cd /home/user | ||
| + | # Force binary mode transfer | ||
| + | option transfer binary | ||
| + | # Download file to the local directory d:\ | ||
| + | get examplefile.txt d:\ | ||
| + | # Disconnect | ||
| + | close | ||
| + | # Connect as a different user | ||
| + | open user2@example.com | ||
| + | # Change the remote directory | ||
| + | cd /home/user2 | ||
| + | # Upload the file to current working directory | ||
| + | put d:\examplefile.txt | ||
| + | # Disconnect | ||
| + | close | ||
| + | # Exit WinSCP | ||
| + | exit | ||
| ===== Checking Results ===== | ===== Checking Results ===== | ||