Differences
This shows you the differences between the selected revisions of the page.
guide_automation_conditional 2021-06-30 | guide_automation_conditional 2022-10-21 (current) | ||
Line 35: | Line 35: | ||
If you do not want to use .NET assembly, for simple conditions or conditions involving local files, you may be able to move the condition outside of WinSCP [[scripting|script]] into a [[guide_automation_advanced#batch_file|wrapper batch file]]. | If you do not want to use .NET assembly, for simple conditions or conditions involving local files, you may be able to move the condition outside of WinSCP [[scripting|script]] into a [[guide_automation_advanced#batch_file|wrapper batch file]]. | ||
- | For example you can use an [[https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/if|''if'' command]] to test a local file existence before uploading it: | + | For example you can use an [[https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/if|''if'' command]] to test a local file existence before uploading it: |
<code batch> | <code batch> | ||
Line 49: | Line 49: | ||
( | ( | ||
- | echo open sftp://user:password@example.com/ -hostkey="ssh-rsa 2048 xxxxxxxxxxx...=" | + | echo open sftp://user:password@example.com/ -hostkey="ssh-rsa 2048 xxxxxxxxxxx..." |
if exist %FILE1% echo put %FILE1% | if exist %FILE1% echo put %FILE1% | ||
if exist %FILE2% echo put %FILE2% | if exist %FILE2% echo put %FILE2% |