It's working with the below code.
===========================================================================================
cmd-txt.bat
=============
cd /d C:\Program Files (x86)\WinSCP
winscp.exe /console /script=C:\Users\original.txt
exit
CMD
original.txt
=============
open ftp://<<UserName>>:<<password>>@<<mysite>>.com -explicitssl
get <<YouFileName>>.TXT <<DestinationLocation>>\<<NewFileName>>.txt
bye
===========================================================================================
Thanks
Merit wrote:
Then, How can I download the file. Much appreciated If you provide complete script.
martin wrote:
Merit wrote:
open mysite.com
USEDID
Password
lcd C:\
cd <<directery name where the file is located in mysite.com>>
get <<FileNameToFetch>>.TXT C:\<<DestinationFileName>>.txt
bye
You cannot specify username and password on separate lines in the script. You have to insert them to session URL. You should also indicate a protocol.
E.g.
open ftp://USEDID:Password@mysite.com
.
See
https://winscp.net/eng/docs/scriptcommand_open
https://winscp.net/eng/docs/session_url
cd /d C:\Program Files (x86)\WinSCP
winscp ftp://<<USERiD>>:<<PASSWORD>>@MYSITE.com/<<directery name where the file is located in mysite.com>> /explicitssl
get <<FileNameToFetch>>.TXT C:\<<DestinationFileName>>.txt
exit
CMD
You cannot combine WinSCP and Windows commands in a single file.
In both cases you seem to try to put inputs that you typed onto console into a file. But note that in neither case you are using the file as a source for redirected standard input (what wouldn't work anyway), but as a script files that have a different semantics.