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%
>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%