I am trying to use the WinSCP command line to access an FTP Server. Then download all JPEG's in the root folder and download them to a local folder on my C: drive.

Example of my script below.

>"C:/Program Files (x86)/winscp/winscp.exe" /open ftp://hostname;password@ipaddress/

This opens the connection but when I try to download all the images from the root folder using this.

>get /*.jpg

It times out.
Is there a better way to connect and get all images available?

Ideally I will put this in a batch file eventually when it works.


Use a batch file (e.g. download.bat) like:

"C:\Program Files (x86)\WinSCP\winscp.com" ^
    /ini=nul /log=C:\writable\path\to\winscp.log /command ^
    "open ftp://hostname:password@ftp.example.com/" ^
    "get /*.jpg C:\local\path\" ^

Some references:

You can even have WinSCP generate the script/batch file for you:

enter image description here



get *.jpg


get -filemask=*.jpg -resumesupport=on *

More examples here:http://winscp.net/eng/docs/scriptcommand_get

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.