Request Error code after runnning script

Advertisement

steppi
Joined:
Posts:
7
Location:
German

Request Error code after runnning script

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

Reply with quote

Advertisement

Ben
Joined:
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

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
28,317
Location:
Prague, Czechia

Re: Request Error code after runnning script

Please read FAQ.
_________________
Martin Prikryl

Reply with quote

steppi
Joined:
Posts:
7
Location:
German

Re: Request Error code after runnning script

martin wrote:

Please read FAQ.

What is the exact name of the reurn code ?

Can you plesae provide any example ?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
28,317
Location:
Prague, Czechia

steppi wrote:

What is the exact name of the return code variable ? Example ?
I have extended the mentioned FAQ. Please reload :-)
_________________
Martin Prikryl

Reply with quote

steppi
Joined:
Posts:
7
Location:
German

martin wrote:

steppi wrote:

What is the exact name of the return code variable ? Example ?
I have extended the mentioned FAQ. Please reload :-)


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

:ok
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 ?

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
28,317
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

Reply with quote

Advertisement

You can post new topics in this forum