Topic "Winscp batch file won't close/exit upon completion despite having attempted using both commands"

Author Message
kristinebollinger
[View user's profile]

Joined: 2017-09-12
Posts: 1
Location: MN
When I click on batch file it runs and ends at
>winscp
I would like the window to close. Here is the code (xxxxxxxxxxx for security replacement).

@echo off
"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
/log="C:\Users\xxxxxxxxxxxx\Desktop\WinSCP.log" /ini=nul ^
/command ^
"open sftp://xxxxxxxxxxxx.com/ -hostkey=""ssh-rsa 2048 9e:c2:dd:6d:86:a6:30:56:9d:ea:99:de:ff:c3:5f:2d"" -rawsettings FSProtocol=2 ProxyMethod=3 ProxyHost=""xxxxxxxxxxxx"" ProxyPort=xxxxxxxxxxxx ProxyUsername=""xxxxxxxxxxxx"" ProxyPassword=""xxxxxxxxxxxx""" ^
"synchronize local K:\test /outbound/ylx"
"exit"

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

exit /b %WINSCP_RESULT%
martin◆
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26705
Location: Prague, Czechia
You are missing ^ at the end of the line with synchronize command.
Advertisements

You can post new topics in this forum

Search

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License