WINSCP stuck at sending files via BAT file.

Advertisement

anandvarkeyphilips
Joined:
Posts:
1

WINSCP stuck at sending files via BAT file.

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.
@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

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,390
Location:
Prague, Czechia

Re: WINSCP stuck at sending files via BAT file.

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"

Reply with quote

Advertisement

You can post new topics in this forum