Q:

How to download files using WinSCP command line?

I have created a .txt file and saved it as abc.txt. I'm trying to use this to download files from a remote server.
The contents of the said .txt file are:
option batch abort
option confirm off
open stfp://root:password@123.456.789.2/ -hostkey="ssh-rsa AA:BB:CC:12:22"
get %1%
exit

I'm trying to run this file via command prompt. So I've opened the cmd prompt, and enter commands as follows
cd  C:\Program Files (x86)\WinSCP

winscp E:\Ritesh\abc.txt /parameter // file.csv

file.csv being the remote file I want to download. However, this is not working. I can't figure out why. Please help

A:

You are missing the /script switch:
winscp /script=E:\Ritesh\abc.txt /parameter // file.csv

