How to Automate FTP Transfers
If you want to automate FTP transfers then you can do so by programming a batch file. A batch file in Windows executes a selection of command line tasks. As the command prompt (the modern DOS simulator) is capable of connecting to an FTP server, you can configure a batch script to perform the list of tasks that you wish it to do. For example if you want to upload a file to multiple servers without doing it manually, you can automate it with a batch script. Alternatively, you can also write a script to use whenever you want to upload a file to a particular server automatically.
Instructions
-
-
1
Click "Start," type "notepad" and press "Enter." You will write your batch script here.
-
2
Type the following code, as an example, to create an automatic upload script:
@echo off
echo user USER > ftpcmd.dat
echo PASSWORD>> ftpcmd.dat
echo bin>> ftpcmd.dat
echo put %1>> ftpcmd.dat
echo quit>> ftpcmd.dat
ftp -n -s:ftpcmd.dat FTPSITE.COM
del ftpcmd.dat
-
-
3
Replace "USER," "PASSWORD" and "FTPSITE" with the relevant FTP server details you have. If you want to create an automation script that uploads to multiple servers then repeat the code, minus the "@echo off", directly below the existing script.
-
4
Click "File," then "Save As." Browse to the Windows directory. Click the "File type" menu and choose "All Files." Title the file "upload.bat" and click "Save."
-
5
Click "Start," then type "cmd" and press "Enter." Type "upload file.txt" and replace "file.txt" with the location of, and the file name of, the file you wish to upload. This will now be uploaded to the FTP server.
-
1
Tips & Warnings
You can use any of the FTP commands in your batch script to perform whichever tasks you like.