Batch command to check if FTP connection is successful -
i writing batch command send data via ftp. before sending actual data need find if ftp server active/running. how check in batch command?
the server responds "220 server ready" message when connected.
do this:
yourftpcommand | find /i /v "220 server ready" && goto :servernotready
explanation:
- pipe output of ftp command find
- do case insensitive (/i) search output not contain (/v) string "220 server ready"
- go someplace if such string found (&&)
Comments
Post a Comment