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

Advertisement

kristinebollinger
Joined:
Posts:
1
Location:
MN

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

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%

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

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

You are missing ^ at the end of the line with synchronize command.

Reply with quote

Advertisement

You can post new topics in this forum