Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

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.
steppi

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?
martin

I have extended the mentioned FAQ. Please reload :-)
steppi

What is the exact name of the return code variable ? Example ?
martin

Re: Request Error code after runnning script

Please read FAQ.
steppi

sorry currently find nothing
Ben

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

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