How to check the return code for ftp in windows nt scripting - TechRepublic
Question
November 24, 2010 at 03:40 AM
anju.patel

How to check the return code for ftp in windows nt scripting

by anju.patel . Updated 15 years, 7 months ago

Hi,
I have a windows script which ftp’s the files from one location to another unix location
I need to check whether the ftp was successful or not.
How can I do the needful?
Here is the code

echo FTP to userevr – File Verification Started >>%LOGFILE%

IF NOT EXIST D:\rs_survey_result.txt GOTO DoNotFTP

IF NOT EXIST D:\rs_survey_error.txt GOTO DoNotFTP

IF NOT EXIST D:\rs_scheduled_survey.txt GOTO DoNotFTP

IF NOT EXIST D:\rs_scheduled_survey_set.txt GOTO DoNotFTP

echo FTP to userevr – All files are present >>%LOGFILE%

ftp -s:D:\FTPto.sh >>%LOGFILE%
echo %errorlevel% >>%LOGFILE%

echo FTP to userevr Completed >>%LOGFILE%
echo. |time |find “current” >>%LOGFILE%

code for FTPto.sh is as follows :-

open userver
test
teset12010
cd out
put D:\rs_survey_result.txt
put D:\rs_survey_error.txt
put D:\rs_scheduled_survey.txt
put D:\ rs_scheduled_survey_set.txt
bye

This discussion is locked

All Comments