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

martin

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"
anandvarkeyphilips

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