Velvet Star Monitor

Standout celebrity highlights with iconic style.

updates

How to connect WinSCP through command line not in GUI mode?

Writer Matthew Harrington

Connect WinSCP console through command-line. Run batch file in it. Commands should be included in batch file for connecting with the server.

1 Answer

A basic batch file for connecting to SFTP server with WinSCP scripting is like:

winscp.com /log=c:\writable\path\winscp.log /ini=nul /command ^ "open sftp://username:password@ -hostkey=""...""" ^ "some command like put for upload" ^ "exit"

For details, see a guide to Automating file transfers to SFTP server.

For the -hostkey switch see Verifying the host key in script.


Easier is to have WinSCP generate a complete transfer script or even batch file for you:

enter image description here

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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