Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

Raj

Re: Can ERRORLEVEL detect a failed login

I'm having same issue please assist on it.
tbode2011

Thanks for the quick solution

Note that IF ERRORLEVEL X means IF ERRORLEVEL >= X.

Martin,
I totally forgot the >= meaning. At one time I had the conditions reversed in their order but probably rearranged them for 'clarity'.
martin

Re: Can ERRORLEVEL detect a failed login

I have sent you an email.
tbode2011

Can ERRORLEVEL detect a failed login

winscp.com /script=automate.txt /log="C:\WinSCP\logs\mylog.log"
IF ERRORLEVEL 0 GOTO SUCCESS
IF ERRORLEVEL 1 GOTO FAILED
:FAILED
ECHO Fail
GOTO DONE
:SUCCESS
ECHO SUCCESS
:DONE

----This is AUTOMATE.TXT----
option batch abort
option confirm off
open AAAAAAAAA:PPPPPPP@NN.NN.NN.NN:21
cd inbound
put C:\pm_server\qwerty\uiop\*.837
cd ..
cd outbound
get *.* C:\pm_server\qwerty\incoming\uiop\*.*
rm *.*
exit

When I run this with an invalid password I get
Access Denied
Authentication Failed
but the ERRORLEVEL is returned as 0

How can I detect a failed login?