Differences
This shows you the differences between the selected revisions of the page.
| 2011-02-08 | 2011-02-08 | ||
| no summary (58.26.83.200) (hidden) | Restored revision 1290440058. Undoing revision 1297154134. (martin) (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. | ||
| - | # Automatically answer all prompts negatively not to stall | + | 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. |
| - | # the script on errors | + | |
| - | option batch on | + | 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). |
| - | # Disable overwrite confirmations that conflict with the previous | + | |
| - | option confirm off | + | Multiple sessions can be opened simultaneously. Use the ''[[script_commands#session|session]]'' command to switch between them. |
| - | # Connect using a password | + | |
| - | # open user:password@example.com | + | Note that the first connection to an SSH server requires [[scripting#hostkey|verification of the host key]]. |
| - | # Connect | + | Also the first connection to FTPS host with [[ftps#certificate|certificate]] signed by untrusted authority requires verification of the certificate. |
| - | 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 ===== | ||