Differences
This shows you the differences between the selected revisions of the page.
2006-09-26 | 2006-11-06 | ||
for pipe, make sure .com is used, scripting#console (martin) | Moving local files to different location after upload (martin) | ||
Line 55: | Line 55: | ||
exit | exit | ||
</code> | </code> | ||
+ | |||
+ | ===== [[local_move]] Moving local files to different location after upload ===== | ||
+ | WinSCP does not support move command for local files. Instead you can combine WinSCP script with batch file: | ||
+ | |||
+ | <code winscp> | ||
+ | # Make the script abort on any error | ||
+ | option batch abort | ||
+ | # Connect | ||
+ | open session | ||
+ | # Upload the files | ||
+ | put *.* | ||
+ | </code> | ||
+ | |||
+ | Launch the above script from batch file like the one below: | ||
+ | |||
+ | <code> | ||
+ | winscp3.com /script=example.txt | ||
+ | if errorlevel 1 goto error | ||
+ | |||
+ | echo Upload succeeded, moving local files | ||
+ | move *.* c:\backup\ | ||
+ | exit | ||
+ | |||
+ | :error | ||
+ | echo Upload failed, keeping local files | ||
+ | </code> | ||
+ | |||
+ | |||
+ | |||