Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

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

Patryk

Indeed
Thanks

Patryk
martin

Re: Synchronistaion hangs the program

Your problem has nothing to do with WinSCP.
Your batch file syntax is wrong.
You are missing ^ after the lines with synchronize commands.
Patryk

Synchronistaion hangs the program

Hello

While synchronisation is finished, WinSCP stop to work and display "winscp>". Cursor blinks. All fichier and folders are send. But script doesn't make other commands.

Batch file:

@echo off


"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
  /log="C:\xampp\htdocs\WinSCP.log" /ini=nul ^
  /command ^
    "open sftp://xxx@xxx/ -privatekey=C:\Users\xxx\.ssh\id_rsa.ppk -hostkey=""ssh-rsa 2048 xxx""" ^
   "synchronize remote C:\xampp\htdocs\pre-prod-git\test\ /home/xxx/dev/test/"
   "synchronize remote C:\xampp\htdocs\pre-prod-git\xxx\ /home/xxx/dev/xxx/"
    "put C:\xampp\htdocs\pre-prod-git\test.txt /home/xxx/dev/wxxx/" ^
    "put C:\xampp\htdocs\pre-prod-git\test2.txt /home/xxx/dev/xxx/" ^
    "exit"

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