errorlevel problem
Hi there
I created a small script.txt like this:
option batch on
option confirm off
open ged@192.168.69.50
option transfert binary
# Upload files to current working directory
put c:\temp
close
exit
and a test.bat like this:
rem @echo off
cd "\Program Files\Winscp3"
Winscp3.com /script=ged.txt
if errorlevel 1 goto error
echo "ok"
goto end
:error
echo Error: %errorlevel%
:end
I get the errorlevel = 1 but the winscp3 log tells me that:
...
. 2006-06-20 14:28:51.698 Opening remote file.
> 2006-06-20 14:28:51.698 Type: SSH_FXP_OPEN, Size: 63, Number: 136451
< 2006-06-20 14:28:51.698 Type: SSH_FXP_HANDLE, Size: 13, Number: 136451
> 2006-06-20 14:28:51.698 Type: SSH_FXP_WRITE, Size: 217, Number: 136966
. 2006-06-20 14:28:51.698 1 skipped SSH_FXP_WRITE, SSH_FXP_READ, SSH_FXP_DATA and SSH_FXP_STATUS packets.
> 2006-06-20 14:28:51.698 Type: SSH_FXP_CLOSE, Size: 13, Number: 137220
> 2006-06-20 14:28:51.698 Type: SSH_FXP_SETSTAT, Size: 59, Number: 136713
< 2006-06-20 14:28:51.698 Type: SSH_FXP_STATUS, Size: 24, Number: 137220
< 2006-06-20 14:28:51.698 Status/error code: 0
< 2006-06-20 14:28:51.698 Type: SSH_FXP_STATUS, Size: 24, Number: 136713
< 2006-06-20 14:28:51.698 Status/error code: 0
. 2006-06-20 14:28:51.698 Closing connection.
Can somebody tell me why I don't get 0 ?
Thanks in advance for your help
Best regards
Ralf
I created a small script.txt like this:
option batch on
option confirm off
open ged@192.168.69.50
option transfert binary
# Upload files to current working directory
put c:\temp
close
exit
and a test.bat like this:
rem @echo off
cd "\Program Files\Winscp3"
Winscp3.com /script=ged.txt
if errorlevel 1 goto error
echo "ok"
goto end
:error
echo Error: %errorlevel%
:end
I get the errorlevel = 1 but the winscp3 log tells me that:
...
. 2006-06-20 14:28:51.698 Opening remote file.
> 2006-06-20 14:28:51.698 Type: SSH_FXP_OPEN, Size: 63, Number: 136451
< 2006-06-20 14:28:51.698 Type: SSH_FXP_HANDLE, Size: 13, Number: 136451
> 2006-06-20 14:28:51.698 Type: SSH_FXP_WRITE, Size: 217, Number: 136966
. 2006-06-20 14:28:51.698 1 skipped SSH_FXP_WRITE, SSH_FXP_READ, SSH_FXP_DATA and SSH_FXP_STATUS packets.
> 2006-06-20 14:28:51.698 Type: SSH_FXP_CLOSE, Size: 13, Number: 137220
> 2006-06-20 14:28:51.698 Type: SSH_FXP_SETSTAT, Size: 59, Number: 136713
< 2006-06-20 14:28:51.698 Type: SSH_FXP_STATUS, Size: 24, Number: 137220
< 2006-06-20 14:28:51.698 Status/error code: 0
< 2006-06-20 14:28:51.698 Type: SSH_FXP_STATUS, Size: 24, Number: 136713
< 2006-06-20 14:28:51.698 Status/error code: 0
. 2006-06-20 14:28:51.698 Closing connection.
Can somebody tell me why I don't get 0 ?
Thanks in advance for your help
Best regards
Ralf