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

josep

Why this script don´t return error or success?

I used the winscp generator and the file is uploaded, all seems to work, but I don´t get the error or success words when finished, and the ms-dos console keeps open, with word winscp>. I think something with spaces or " is wrong...What could be wrong here?
...............................................
@echo off

"C:\route to winscp\WinSCP.com" ^
/log="C:\route to log\log.log" /ini=nul ^
/command ^
"open sftp://user:pass@server:port/ -hostkey=""ssh-rsa ....."" -privatekey=""C:\route to key.ppk"" -passphrase="passphrase" -rawsettings Cipher=""aes,blowfish,3des,chacha20,WARN,arcfour,des"" KEX=""ecdh,dh-gex-sha1,dh-group14-sha1,dh-group1-sha1,rsa,WARN""" ^
"put C:\file to upload /dir to store/" ^
"exit"

set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0 (
echo Success
) else (
echo Error
)

exit /b %WINSCP_RESULT%