command line mode - errorlevel

Core FTP client questions and answers
Post Reply
zzhekov
Posts: 2
Joined: Wed Mar 22, 2006 3:20 pm

command line mode - errorlevel

Post by zzhekov »

I wish to try upload a nonexisting file called "tst.txt" via command line like this

Code (batch file tst.bat):
---------------------
"C:\Program Files\CoreFTP\coreftp.exe" -ssl -s -O -u "C:\tst.txt" ftp://username:password@domain.com -p /in/
If "%ERRORLEVEL%"=="" goto noerrlvl
If %ERRORLEVEL%==0 goto answer0
If %ERRORLEVEL%==1 goto answer1
If %ERRORLEVEL%==30 goto answer30
echo %ERRORLEVEL%
goto bad

:noerrlvl
echo Empty!!!
:answer0
echo 0
goto bad
:answer1
echo 1
goto bad
:answer30
echo 30
goto bad

:bad
pause
---------------------

According to help for command line, coreftp must return result 30 in ERRORLEVEL, but I have result 0.
What is wrong and what is the correct syntax to use?
Thanks

Zhivko
zzhekov
Posts: 2
Joined: Wed Mar 22, 2006 3:20 pm

zhivko

Post by zzhekov »

my CoreFTP version is 1.3c b1447.3

When I issue the following .bat file:

"\program files\coreftp\coreftp.exe" -ssl -s -O -u c:\noexist.txt ftp://user:pass@coreftp.com/ -p /remote_dir/
echo %ERRORLEVEL%

I see again 0, but if syntax is

"\program files\coreftp\coreftp.exe" -ssl -s -O -u c:\noexist.txt ftp://user:pass@coreftp.com/remote_dir/
echo %ERRORLEVEL%

reult is 30

I see if -p is supplied, CoreFtp first create file with name noexist.txt, than delete this file. May be this is problem?
Post Reply