Differences
This shows you the differences between the selected revisions of the page.
| 2014-11-25 | 2014-11-25 | ||
| Locking files while uploading / Upload to temporary file name (martin) | moving misplaced section (martin) | ||
| Line 619: | Line 619: | ||
| exit 1 | exit 1 | ||
| } | } | ||
| + | </code> | ||
| + | |||
| + | ==== Using WinSCP Scripting ==== | ||
| + | WinSCP scripting does not support move command for local files. Instead you can combine WinSCP script with batch file: | ||
| + | |||
| + | <code winscp> | ||
| + | option batch abort | ||
| + | option confirm off | ||
| + | # Connect | ||
| + | open mysession | ||
| + | # Upload the files | ||
| + | put *.* | ||
| + | </code> | ||
| + | |||
| + | Launch the above script from batch file like the one below: | ||
| + | |||
| + | <code batch> | ||
| + | winscp.com /script=example.txt | ||
| + | if %ERRORLEVEL% neq 0 goto error | ||
| + | |||
| + | echo Upload succeeded, moving local files | ||
| + | move *.* c:\backup\ | ||
| + | exit 0 | ||
| + | |||
| + | :error | ||
| + | echo Upload failed, keeping local files | ||
| + | exit 1 | ||
| </code> | </code> | ||
| Line 720: | Line 747: | ||
| exit 1 | exit 1 | ||
| } | } | ||
| - | </code> | ||
| - | |||
| - | ==== Using WinSCP Scripting ==== | ||
| - | WinSCP scripting does not support move command for local files. Instead you can combine WinSCP script with batch file: | ||
| - | |||
| - | <code winscp> | ||
| - | option batch abort | ||
| - | option confirm off | ||
| - | # Connect | ||
| - | open mysession | ||
| - | # Upload the files | ||
| - | put *.* | ||
| - | </code> | ||
| - | |||
| - | Launch the above script from batch file like the one below: | ||
| - | |||
| - | <code batch> | ||
| - | winscp.com /script=example.txt | ||
| - | if %ERRORLEVEL% neq 0 goto error | ||
| - | |||
| - | echo Upload succeeded, moving local files | ||
| - | move *.* c:\backup\ | ||
| - | exit 0 | ||
| - | |||
| - | :error | ||
| - | echo Upload failed, keeping local files | ||
| - | exit 1 | ||
| </code> | </code> | ||