Differences
This shows you the differences between the selected revisions of the page.
guide_ftp_script_to_sftp 2020-08-27 | guide_ftp_script_to_sftp 2022-10-21 (current) | ||
Line 1: | Line 1: | ||
====== Converting Windows FTP script to WinSCP SFTP script ====== | ====== Converting Windows FTP script to WinSCP SFTP script ====== | ||
- | This guide explains how to convert existing FTP file transfer script using [[https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/ftp|Windows built-in command-line FTP client]] (''ftp.exe'') to SFTP [[scripting|script using WinSCP]]. | + | This guide explains how to convert existing FTP file transfer script using [[https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/ftp|Windows built-in command-line FTP client]] (''ftp.exe'') to SFTP [[scripting|script using WinSCP]]. |
You can also use it to convert FTP script using ''ftp.exe'' to WinSCP, in case you want to use some advanced feature that WinSCP offers, such as [[ftps|FTP over TLS/SSL]], [[scriptcommand_synchronize|synchronization]], passive mode,((WinSCP defaults to passive mode.)) [[script_upload_multiple_servers|parametrized script]], [[scripting#timestamp|timestamped file names]], [[script_custom_listing_format_csv|custom directory listing format]], UTF-8 support, preserving file timestamp, recursive downloads and uploads, and others. | You can also use it to convert FTP script using ''ftp.exe'' to WinSCP, in case you want to use some advanced feature that WinSCP offers, such as [[ftps|FTP over TLS/SSL]], [[scriptcommand_synchronize|synchronization]], passive mode,((WinSCP defaults to passive mode.)) [[script_upload_multiple_servers|parametrized script]], [[scripting#timestamp|timestamped file names]], [[script_custom_listing_format_csv|custom directory listing format]], UTF-8 support, preserving file timestamp, recursive downloads and uploads, and others. | ||
Line 59: | Line 59: | ||
Replace the ''%%sftp://%%'' with the ''%%ftp://%%'', if you keep using the FTP protocol. | Replace the ''%%sftp://%%'' with the ''%%ftp://%%'', if you keep using the FTP protocol. | ||
+ | |||
+ | ===== [[errors]] Error Handling ===== | ||
+ | WinSCP by default aborts the script when some of the commands fail. On the contrary ''ftp.exe'' continues processing a script after an error. If your original ''ftp.exe'' script relies on this behavior, you can emulate it in WinSCP by switching the [[scriptcommand_option#batch|batch mode]] to ''on'' at the beginning of your script: | ||
+ | <code winscp> | ||
+ | option batch on | ||
+ | </code> | ||
===== Converting Commands ===== | ===== Converting Commands ===== |