Can't exit WinsCP once script complete

Advertisement

Renat
Guest

Can't exit WinsCP once script complete

This script cut and paste files from a folder on FTP server. This is works, but from some reason, after running the section is not closed and I need to rate manually exit.
@echo off
 
"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
  /log="C:\\exlibris.log" /ini=nul ^
  /command ^
    "open sftp://**********:10022/ -hostkey=""ssh-rsa 4096 upqTBzuxy+fGrA4+dFQaWXmIq7/E1CwyAjqRSwq9eQo"" -privatekey=""C:\test\test.ppk"" -rawsettings AgentFwd=1 ProxyPort=1" ^
    "get -delete /test/* C:\test\" ^
    
    "exit"
 
set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0 (
  echo Success
) else (
  echo Error
)
 
exit /b %WINSCP_RESULT%

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum