|I don't think you can use errorlevel from ftp directly. If that is the case, you will have to redirect or pipe the output of ftp, then use "find" to analyze it. The searchstring will vary depending on what ftp command you want to verify. f/e: if "get", the error will be "550 no such file or directory", but if "put", the error might be "file not found" (if that is indeed the cause of the error - there are other possiblities such as the file being inaccessible (opened/in use etc). then your command would look like this:|
ftp -n -s:ftp.conf | find /i "no such file" && goto :fail || goto :success
Of course, errorlevel is now opposite polarity from the usual: zero means "problem/error" and not-zero means "ok" (because "find" is looking for error message, and if found, then "problem") There is no "general purpose" failure with ftp because there are about 35 or 40 different functions each of which will generate a different error-message on failure. That all depends on the content of your ftp script "ftp.conf".