Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

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

Guest

I downloaded the program and tested it with your command and it worked perfectly! Thank you so much! I'll make a PayPal donation to the cause.
Guest

Thank you. I'll look through the documentation and do some testing. I appreciate the help very much.
Pathduck

Hi!

'winscp.com' is the thing to use for scripting, read the docs here:
https://winscp.net/eng/docs/scripting

Open a connection and exit:
winscp.com /command "open ftp://anonymous:password@ftp.scene.org/" "exit"


Then check return code of last command:
echo %errorlevel%

0


So if it doesn't work or server is down:

winscp.com /command "open ftp://anonymous:email@domain.com@ftp.scene.org:1234/" "exit"

Connecting to ftp.scene.org:1234 ...
Connection failed.
No connection could be made because the target machine actively refused it.
Connection failed.

echo %errorlevel%
1
rhnielsen

Capability

I was looking through the documentation and not sure I can accomplish what I need. I would like to ask a simple question if possible. I'm no expert on FTP or scripting, but not afraid to do the work to make it work. Before I go down that route can someone confirm that I can accomplish the following.........

I want to put a command line at the top of a batch job that confirms that the receiving FTP server is online and functioning. I'm thinking I would write a login script and if it does not work WinSCP would return some type of error code which the batch job can look for. If the error exists the batch job would exit and not try to send the data file.

Can this be done using WinSCP?

Thank you