Request Error code after runnning script

Advertisement

steppi
Joined:
Posts:
5
Location:
German

Request Error code after runnning script

Try to run bat-file :
winscp.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

Advertisement

steppi
Joined:
Posts:
5
Location:
German

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

bat-file:
set errorlevel=0
C:\programm\WinSCP3\WinSCP.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 can I use a Windows command in the script? e.g del?

Reply with quote

martin
Site Admin
martin avatar

if errorlevel 0 goto ok
if errorlevel 0 is matched always as if errorlevel x means "if errorlevel is 0 or greater". Check the documentation for if. Please follow the example in FAQ.

Reply with quote

Advertisement

You can post new topics in this forum