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?
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?