Topic "Can ERRORLEVEL detect a failed login"

Author Message
tbode2011
[View user's profile]

Joined: 2011-05-18
Posts: 2
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?
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
I have sent you an email.
_________________
Martin Prikryl
tbode2011
[View user's profile]

Joined: 2011-05-18
Posts: 2
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'.
Raj

Guest


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

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License