Differences

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

2011-07-31 2011-07-31
scriptcommand (martin) scriptcommand_* (martin)
Line 2: Line 2:
//This article contains detailed description of scripting/automation functionality. You may want to see [[guide_automation|simplified guide]] to the functionality instead.// //This article contains detailed description of scripting/automation functionality. You may want to see [[guide_automation|simplified guide]] to the functionality instead.//
-In addition to [[interfaces|graphical interface]], WinSCP offers scripting/console interface with many [[script_commands|commands]]. The commands can be typed in interactively, or read from script file or another source.+In addition to [[interfaces|graphical interface]], WinSCP offers scripting/console interface with many [[scriptcommands|commands]]. The commands can be typed in interactively, or read from script file or another source.
&screenshotpict(scripting) &screenshotpict(scripting)
Line 11: Line 11:
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. 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.
-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). +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 ''[[scriptcommand_option|option batch on]]''. For the batch mode it is recommended to turn off confirmations using ''[[scriptcommand_option|option confirm off]]'' to allow overwrites (otherwise the overwrite confirmation prompt would be answered negatively, making overwrites impossible).
-Multiple sessions can be opened simultaneously. Use the ''[[script_commands#session|session]]'' command to switch between them.+Multiple sessions can be opened simultaneously. Use the ''[[scriptcommand_session|session]]'' command to switch between them.
Note that the first connection to an SSH server requires [[scripting#hostkey|verification of the host key]]. Note that the first connection to an SSH server requires [[scripting#hostkey|verification of the host key]].
Line 49: Line 49:
The following commands are implemented. The following commands are implemented.
-To see help for the command, read respective documentation article below or type command ''[[script_commands_help|help <command>]]'' directly in console.+To see help for the command, read respective documentation article below or type command ''[[scriptcommand_help|help <command>]]'' directly in console.
^ Command                          ^ Description ^ ^ Command                          ^ Description ^
Line 80: Line 80:
===== [[hostkey]] Verifying the Host Key or Certificate in Script ===== ===== [[hostkey]] Verifying the Host Key or Certificate in Script =====
-The first connection to an SSH server requires [[ssh#verifying_the_host_key|verification of the host key]]. To automate the verification in script, use ''hostkey'' switch of ''[[script_commands#open|open]]'' command to accept the expected hostkey automatically.+The first connection to an SSH server requires [[ssh#verifying_the_host_key|verification of the host key]]. To automate the verification in script, use ''hostkey'' switch of ''[[scriptcommand_open|open]]'' command to accept the expected hostkey automatically.
You can find the key fingerprint on [[ui_fsinfo|Server and Protocol Information Dialog]]. You can also copy the key fingerprint to clipboard from the confirmation prompt on the first (interactive) connection using //Copy Key// button. You can find the key fingerprint on [[ui_fsinfo|Server and Protocol Information Dialog]]. You can also copy the key fingerprint to clipboard from the confirmation prompt on the first (interactive) connection using //Copy Key// button.
-[[ftps#certificate|FTPS certificate]] signed by untrusted authority may also need to be verified. To automate the verification in script, use ''certificate'' switch of ''[[script_commands#open|open]]'' command to accept the expected certificate automatically.+[[ftps#certificate|FTPS certificate]] signed by untrusted authority may also need to be verified. To automate the verification in script, use ''certificate'' switch of ''[[scriptcommand_open|open]]'' command to accept the expected certificate automatically.

Last modified: by martin