Topic "There is no valid returncode when aborting ftp(s) transfer"

Author Message
Niko
[View user's profile]

Joined: 2012-11-15
Posts: 4
Location: Switzerland
Hello dear WinSCP Team

We are using WinSCP in Batchmode and working with returncodes to determin, if a filetransfer was valid.
We got some complaints that some of the files where never been transferred, but we never got an errormessage returned. We found afterwards the error, when we checked the
Log-File, but we cant check every Log-File manually.

Our Problem can be replicated when we tried to connect to a host, which is required a certificate and a popupwindow appears. WinSCP closes (cancel) the Window after some time
and ends without a transfer (which is totally correct). Unfotunately, we cant determine, without Returncodes, if the transfer was successful or not.

Is there a possibility to activate Returncodes in WinSCP? So we could check if the Host, path, file, certificate, etc. are missing or if everything went well?.

Command-line: "C:\Program Files\WinSCP\WinSCP.exe" /console=511 /consoleinstance=_3560_845 "XXX@XXX.XXX.XX" "/log=c:\XX.Log.txt" "/command" "option batch abort" "option confirm off" "ls /Test_Test" "exit"

Using Batch-Command-Line, WinSCP 5.1.1 Windows OS: Various (same problem)


Kind regards

Niko Balomatis
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24991
Location: Prague, Czechia
How do you test for exit code?
_________________
Martin Prikryl
Niko
[View user's profile]

Joined: 2012-11-15
Posts: 4
Location: Switzerland
echo errorlevel=%errorlevel%

if %errorlevel%==0 goto ok

:nok
exit %errorlevel%

Surprisedk
exit 0
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24991
Location: Prague, Czechia
Ok, than you need to use winscp.com, not winscp.exe
https://winscp.net/eng/docs/executables
_________________
Martin Prikryl
Niko
[View user's profile]

Joined: 2012-11-15
Posts: 4
Location: Switzerland
That's interesting. In our CMD File we use:
*...
*call "%CurrentDrive%:\Program Files\WinSCP\winscp.com" %session% /log=%log% /command "option batch abort" "option confirm *off" "ls %dir%" "exit" > %out%

*echo errorlevel=%errorlevel%
*
*if %errorlevel%==0 goto ok
*
*:nok
*exit %errorlevel%
*
*Surprisedk
*exit 0

and in in the Logfile is:

*WinSCP Version 5.1.1 (Build 2735) (OS 5.1.2600 Service Pack 3)
*. 2012-11-14 15:14:11.905 Configuration: C:\Program Files\WinSCP\WinSCP.ini
*. 2012-11-14 15:14:11.905 Local account: XXXX
*. 2012-11-14 15:14:11.905 Working directory: C:\Batch\Pgm
*. 2012-11-14 15:14:11.905 Command-line: "C:\Program *Files\WinSCP\WinSCP.exe" /console=511 /consoleinstance=_3560_845 "XXX@XXX" "/log=c:\XXX\Log\XXX.Log.txt" "/command" "option *batch abort" "option confirm off" "ls /BAGJAS_Test" "exit"

We have used in the beginning already winscp.com. Do we have to change a setting on the winscp.ini?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24991
Location: Prague, Czechia
Ok, please attach a complete session log file.
Niko
[View user's profile]

Joined: 2012-11-15
Posts: 4
Location: Switzerland
There are two Logs. Sending both
WinSCPLog.txt (3.31 KB) [Download]

Description: The second Log

OutputLog.txt (919 Bytes) [Download]

Description: The First Log

martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24991
Location: Prague, Czechia
Try:
Code:
call "%CurrentDrive%:\Program Files\WinSCP\winscp.com" /log=%log% /command "option batch abort" "option confirm" "open %session%"  "ls %dir%" "exit" > %out%
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24991
Location: Prague, Czechia
This bug has been added to the tracker:
https://winscp.net/tracker/show_bug.cgi?id=953
Jaredt
[View user's profile]

Joined: 2012-08-15
Posts: 7
Location: London
I am still unalbe to upload files over FTPS using a SOCKS5 proxy. Directory listings and downloads seem to work OK. see:

https://winscp.net/forum/viewtopic.php?t=11508

which I have updated.
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