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

Advertisement

Niko
Joined:
Posts:
4
Location:
Switzerland

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

Hello dear WinSCP Team

We are using WinSCP in batch mode and working with return codes to determine, if a file transfer 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 can't 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 popup window appears. WinSCP closes (cancel) the Window after some time
and ends without a transfer (which is totally correct). Unfotunately, we can't determine, without return codes, if the transfer was successful or not.

Is there a possibility to activate return codes 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

Reply with quote

Advertisement

Niko
Joined:
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%
 
:ok
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?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,453
Location:
Prague, Czechia

Try:
call "%CurrentDrive%:\Program Files\WinSCP\winscp.com" /log=%log% /command "option batch abort" "option confirm" "open %session%"  "ls %dir%" "exit" > %out%

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum