Please note that this is a Hosted~FTP~ resource, scripting support is available to our Enterprise level customers.
WinSCP is an FTP, FTPS, SFTP client that allows managing and transferring files and folders from your FTP site straight from your desktop. WinSCP also offers a scripting interface that users to run a command from a file. Before you start scripting with WinSCP, there are a few things you need to have access to first:
Please note: You need to run note pad as administrator when setting up your script. To setup WinSCP automated scripting, follow the steps below:
Run your Notepad as administrator
In the notepad, enter the following command: winscp.exe /console /script=script.txt
The above lets WINSCP know your script file. Save the file name as “script.BAT” in your WinSCP folder. To do this, you need to right-click on your WinSCP application and select Open file location
Save your script.BAT in the WinSCP application folder and Save as type: All Files
Again run the notepad as administrator. In the example script below, we have a login and list all command for more commands please refer to this article. In the notepad, enter the following command below based on your protocol:
Replace username:password with your FTP server or Hosted FTP username and password. If you do not have a Hosted FTP account, replace ftp.hostedftp.com with your FTP server’s hostname.
Protocol | Command |
SFTP | open sftp://username:password@ftp.hostedftp.com/ -hostkey=”ssh-rsa 2048 bc:9d:86:20:2d:68:1a:35:bb:9d:5c:41:f4:eb:69:4c” -rawsettings KEX=”rsa,ecdh,dh-gex-sha1,dh-group14-sha1,WARN,dh-group1-sha1″
ls * |
FTPS | open ftpes://username:password@ftp.hostedftp.com/ -rawsettings KEX=”rsa,ecdh,dh-gex-sha1,dh-group14-sha1,WARN,dh-group1-sha1″
ls * |
FTP | open ftp://username:password@ftp.hostedftp.com/
ls * |
Save the command script as “Script.txt” in the WinSCP application directory. You can double click on the bash script to run and test the connection and commands.