Using version 4.1.5
Logfile states several errorcodes, but the last few ones are 0, meaning success???
All I get from errorlevel is 1, which then reports error in my script.
I am expecting some way of knowing that it completed successfully.
I believe I have tried all combinations of Option batch on|abort|continue and all checks of errorlevel 0|1 etc.
Any help greatly appreciated! only option I have left is to text-search through the logfile, which I find silly.
The file transfer works fine - only the errorlevel-bit is tricky!
Below is bat-script, ftp-script and logfile-piece
.bat file script:
winscp415.exe /log=logs\ftplog.log /script=transfer.ftp
if errorlevel 1 goto FTPError1
echo Success ftp 1
goto FTPend
:FTPError1
start /w %workdir%Pay_FTP_alert_bad.bat
%workdir%sleep 10
echo Error 1
goto FTPend
:FTPend
Other stuff
FTP Script:
prompt off
option confirm off
option batch abort
open xxxxx:password@server1
cd /server1/transfer/files
option transfer binary
put *.xml
close
exit
Logfile (last part):
Checking existence of file.
Type: SSH_FXP_LSTAT, Size: 90, Number: 64519
Type: SSH_FXP_STATUS, Size: 29, Number: 64519
Status/error code: 2
Checking existence of partially transfered file.
Type: SSH_FXP_LSTAT, Size: 99, Number: 64775
Type: SSH_FXP_STATUS, Size: 29, Number: 64775
Status/error code: 2
Opening remote file.
Type: SSH_FXP_OPEN, Size: 115, Number: 65027
Type: SSH_FXP_HANDLE, Size: 13, Number: 65027
Type: SSH_FXP_WRITE, Size: 32764, Number: 65542
468 skipped SSH_FXP_WRITE, SSH_FXP_READ, SSH_FXP_DATA and SSH_FXP_STATUS packets.
Type: SSH_FXP_CLOSE, Size: 13, Number: 125956
Type: SSH_FXP_STATUS, Size: 24, Number: 125190
Type: SSH_FXP_STATUS, Size: 24, Number: 125446
Type: SSH_FXP_STATUS, Size: 24, Number: 125702
Type: SSH_FXP_STATUS, Size: 24, Number: 125956
Status/error code: 0
Type: SSH_FXP_RENAME, Size: 184, Number: 126226
Type: SSH_FXP_STATUS, Size: 24, Number: 126226
Status/error code: 0
Type: SSH_FXP_SETSTAT, Size: 102, Number: 65289
Type: SSH_FXP_STATUS, Size: 24, Number: 65289
Status/error code: 0
Closing connection.
Sending special code: 12
Sent EOF message