Make sure to update these values appropriately:
myftpusername = FTP username
mypassword = FTP user’s password
127.0.0.1 = IP or hostname of machine you are connecting to
C:\mydirectory = directory you wish to copy to the home directory of your FTP user

Then the following can be placed in a .bat file to execute the upload above:
C:\Program Files\WinSCP\winscp.exe /console /script=myscript.txt

Note you may need to update the path to the WinSCP executable or the myscript.txt file depending on your installation.

One Response to “Command line FTP with WinSCP”

How do I update the values of the username and password? I’m trying to completely automate the process for someone else to send me files, and I don’t want them to have to remember their username and password. I can’t seem to get a script to enter those without prompting.