Computing.Net > Forums > Programming > how to check ftp error in win ?

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

how to check ftp error in win ?

Reply to Message Icon

Name: philipshang
Date: August 29, 2006 at 15:00:08 Pacific
OS: win xp
CPU/Ram: pentium 4 xeon
Product: intel
Comment:

i am trying to run ftp on the win box to put some files to a remote server. this is done by a script and the command looks like: "ftp -n -i -s:/ftp_cmd_file ftp_server".

i'd like to know how I can check the ftp exit status. I tried to use $? as in unix env, but it does not work.

any recommendations?

much appreciated.

philip




Sponsored Link
Ads by Google

Response Number 1
Name: tonysathre
Date: August 30, 2006 at 10:29:28 Pacific
Reply:

Try this:

@echo off
ftp -n -i -s:/ftp_cmd_file ftp_server
echo %errorlevel%
:EOF


@echo off
ftp -n -i -s:/ftp_cmd_file ftp_server
if %errorlevel% == 1 (echo Failed
) else (echo Succeeded)
:EOF

An errorlevel of 1 or higher usually means there was an error, 0 means success.


login: yes
password: dont have one

password is incorrect

login: yes
password: incorrect


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: how to check ftp error in win ?

How to disable Windows errors in C www.computing.net/answers/programming/how-to-disable-windows-errors-in-c-/11257.html

how to check batch file www.computing.net/answers/programming/how-to-check-batch-file/2856.html

how to solve this error? www.computing.net/answers/programming/how-to-solve-this-error/4318.html