A simple Windows script. A simple list of commands.

Advertisement

SusanS2
Guest

A simple Windows script. A simple list of commands.

We've had 4 of our company's top programmers working for hours on this simple issue:

We can manually execute WinSCP.com and connect to our ftp server and execute ls to list remote
files (so we KNOW this can work.)

We need 2 files.
1. A Windows .bat (batch) file
2. All the commands that WinSCP.com will execute

But apparently there are many strange (and undocumented) rules about what you can (and can't) mix on the WinSCP.com command line.

In which of the 2 files would we place each of these 5 lines? (We've tried every imaginable combination.)

WinSCP.com
/explicitssl
/script="MyScript.cmds"
ftp://myName:myPassword@ftp.example.com
ls

(Apparently we MUST use /explicitssl, but then are forbidden from using /script.)

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
28,658
Location:
Prague, Czechia

Re: A simple Windows script. A simple list of commands.

You should have started here:
https://winscp.net/eng/docs/guide_automation

Anyway:

winscp.com /script=script.txt

where the script.txt will contain:

open ftpes://myName:myPassword@ftp.example.com/
ls
exit

The ftpes standard for Explicit TLS. Though you can also use open ftp://myName:myPassword@ftp.example.com/ -explicittls (explicitssl is deprecated).

https://winscp.net/eng/docs/scriptcommand_open



The easiest is to have WinSCP generate the script for you:
https://winscp.net/eng/docs/ui_generateurl#script

Reply with quote

Advertisement

You can post new topics in this forum