Topic "WINSCP stuck at sending files via BAT file."

Author Message
anandvarkeyphilips
[View user's profile]

Joined: 2017-03-22
Posts: 1
Hi Team,
Winscp is really good and free. Thank you for this first of all. My Winscp gets stuck at ear moving when i call the bat file with below code.I want to move ear and jar parallelly to different servers inorder to save time. Please advice.
Code:


@echo off

echo Setting path...
PATH=C:\Users\1509967\Documents\DOD\apache-ant-1.8.4;C:\Users\1509967\Documents\DOD\apache-ant-1.8.4\bin;C:\Users\1509967\Documents\DOD\jdk1.6.0_26\bin
echo.

echo Moving to scripts directory for execution...
cd C:\Users\1509967\Documents\DOD\SIT_934\scripts
echo.

echo Building...
call ant -buildfile BuildEar.xml
echo.

cd C:\Program Files (x86)\WinSCP

start  call winscp.com /command "open sftp://username:password@99.99.99.99/directory" "put -permissions=777  "C:\Build\destination\ear\project.ear"" "close" "exit"

start call winscp.com /command "open sftp://username:password@11.11.11.11/directory" "put -permissions=777 "C:\Build\destination\jar\project.jar"" "close" "exit"

pause
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26330
Location: Prague, Czechia
You have quotes wrong.
See https://winscp.net/eng/docs/commandline#syntax

Also it does not make sense to use call to run WinSCP. Also the first argument to start should be console window title.

start "title" winscp.com /command "open sftp://username:password@99.99.99.99/directory" "put -permissions=777 ""C:\Build\destination\ear\project.ear""" "close" "exit"

Or simply (as there are no spaces in the path):

start "title" winscp.com /command "open sftp://username:password@99.99.99.99/directory" "put -permissions=777 C:\Build\destination\ear\project.ear" "close" "exit"
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License