Post a reply

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

jan_van_man

Re: Script for synchronization is working but does not exit

Thanks Martin, it's working now. I appreciate your response
martin

Re: Script for synchronization is working but does not exit

Remove the spaces at the end of the "synchronize" line:
    "lcd C:\Subscriptions\SFTP\FamClaimNumbers\Files" ^
    "synchronize local -filemask=*.*>10DS" ^   
    "exit"

See https://winscp.net/eng/docs/faq_batch_file#newline_escaping
jan_van_man

Script for synchronization is working but does not exit

Hi,

I have an issue with a script that is synchronizing data from one server to another server. The script works and syncs the files and folders I want, but it doesn't exit. I have similar scripts running on the same server and they are all working fine and exiting.

@echo off
 
"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
  /log="C:\WinScp\WinSCP.log" /ini=nul ^
  /command ^
    "open [SERVER_INFORMATION] ^
    "cd /" ^
    "lcd C:\Subscriptions\SFTP\FamClaimNumbers\Files" ^
    "synchronize local -filemask=*.*>10DS" ^   
    "exit"
 
set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0 (
  echo Success
) else (
  echo Error
)
 
exit /b %WINSCP_RESULT%