Differences
This shows you the differences between the selected revisions of the page.
| 2015-01-27 | 2015-01-27 | ||
| library_sessionoptions_parseurl + article (martin) | script session settings (martin) | ||
| Line 102: | Line 102: | ||
| Learn how to write [[script_upload_multiple_servers|Parametrized script]] using ''[[scripting#arguments|/parameter]]'' command-line parameter. | Learn how to write [[script_upload_multiple_servers|Parametrized script]] using ''[[scripting#arguments|/parameter]]'' command-line parameter. | ||
| + | Typically you will use a custom command pattern to provide the value to parameter. | ||
| - | %WINSCP_PATH% | + | For example, to execute an ''example.txt'' script with the first parameter set to a path to a selected remote file, use: |
| + | <code batch> | ||
| + | "%WINSCP_PATH%\winscp.exe" /script=c:\example\example.txt /parameter "!/!" | ||
| + | </code> | ||
| + | |||
| + | ==== Passing Session Settings ==== | ||
| + | |||
| + | As mentioned above use a custom command pattern ''!S'' to pass the current session settings in form of session URL to the script. In the script, pass the URL to ''[[scriptcommand_open|open]]'' command. | ||
| + | |||
| + | <code winscp> | ||
| + | open %1 | ||
| + | </code> | ||
| + | |||
| + | Use ''!S' pattern in the custom command to feed the session URL to script parameter: | ||
| + | |||
| + | <code batch> | ||
| + | "%WINSCP_PATH%\winscp.exe" /script=c:\example\example.txt /parameter !S | ||
| + | </code> | ||