Differences
This shows you the differences between the selected revisions of the page.
2009-05-20 | 2009-07-01 | ||
open mysession (martin) | 4.2.2 bug 197 (martin) | ||
Line 40: | Line 40: | ||
You may want to modify the script automatically. For example you may want to operate it with different file each time. | You may want to modify the script automatically. For example you may want to operate it with different file each time. | ||
- | For simple modifications, you can use environment variables from the script: | + | For simple modifications, you can pass the variable parts of the script from command line: |
- | <code> | + | <code winscp> |
option batch on | option batch on | ||
option confirm off | option confirm off | ||
open mysession | open mysession | ||
- | put %FILE_TO_UPLOAD% | + | put %1% |
exit | exit | ||
</code> | </code> | ||
+ | |||
+ | Execute the above script using syntax: | ||
+ | |||
+ | <code> | ||
+ | winscp.com /script=script.tmp /parameter c:\myfile.txt | ||
+ | </code> | ||
+ | |||
+ | You can also use environment variables in the script. | ||
Alternatively, you can generate new script file each time. To automate that, make a wrapper script file. For simple tasks you can use built-in Windows scripting functionality from batch file (''.bat''). For complex tasks, you will need to use some scripting language, such JavaScript or VBScript from Windows scripting host or PHP or Perl. | Alternatively, you can generate new script file each time. To automate that, make a wrapper script file. For simple tasks you can use built-in Windows scripting functionality from batch file (''.bat''). For complex tasks, you will need to use some scripting language, such JavaScript or VBScript from Windows scripting host or PHP or Perl. |