Synchronistaion hangs the program

Advertisement

Patryk
Guest

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
)

Description: Scrren-shot of console

Sans titre.png

Description: Log "censored" :)

Reply with quote

Advertisement

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

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.

Reply with quote

Advertisement

You can post new topics in this forum