Topic "Request Error code after runnning script"

Author Message
steppi
[View user's profile]

Joined: 2006-10-19
Posts: 7
Location: German
Try to run bat-file : winscp3.com / script=test.txt

Is it possible to request a error-code after performing the script ?
Transfer ok or not ok ?


example script:
option batch on
option confirm on
open **********************
put c:\data\
close
exit
Advertisements
Ben
[View user's profile]

Joined: 2006-10-18
Posts: 2
Location: Paris
I'm also interested by the response.

More generally, how is it possible to manage error codes generated by WinScp???
Is there any error message table in the Documentation?

Thank you for your response.

Ben
steppi
[View user's profile]

Joined: 2006-10-19
Posts: 7
Location: German
sorry currently find nothing
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
Please read FAQ.
_________________
Martin Prikryl
steppi
[View user's profile]

Joined: 2006-10-19
Posts: 7
Location: German
prikryl wrote:
Please read FAQ.


What is the exact name of the reurn code ?

Can you plesae provide any example ?
steppi
[View user's profile]

Joined: 2006-10-19
Posts: 7
Location: German
What is the exact name of the return code variable ? Example ?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
steppi wrote:
What is the exact name of the return code variable ? Example ?

I have extended the mentioned FAQ. Please reload Smile
_________________
Martin Prikryl
steppi
[View user's profile]

Joined: 2006-10-19
Posts: 7
Location: German
prikryl wrote:
steppi wrote:
What is the exact name of the return code variable ? Example ?

I have extended the mentioned FAQ. Please reload Smile



Sorry but the request for the erroelevel not working ... Example:


bat-file:

set errorlevel=0
C:\programm\WinSCP3\WinSCP3.exe /console /script=testscript.txt/log=testscript.log

if errorlevel 0 goto ok

:error
echo error
goto end

Surprisedk
echo ok
goto end

:end


script:
option batch abort
option confirm off
open sftp://******************************
cd /home/
put D:\test*.txt
close
exit


Which return code I get for example not connection or wrong command ?
Always getting status ok ....

How ca I us a windows command in the script ? e.g del ?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
steppi wrote:
if errorlevel 0 goto ok

"if errorlevel 0" is matched always as "if errorlevel x" means "if errorlevel is 0 or greater". Check documentation for "if". Please follow the example in FAQ.
_________________
Martin Prikryl
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