Background: This machine a file "A.TXT" in the C packing directory, need to upload to the FTP server "192.168.0.1" under the "X" directory
Copy Code code as follows:
@echo off
Set Ftpfile=putfiles.ftp
Set Logfile=putfiles.log
echo Open 192.168.0.1 > "%ftpfile%"
REM Change the username and password in the line below to your username and password
echo User username password >> "%ftpfile%"
REM------------------------------
Echo bin >> "%ftpfile%"
REM enters the "X" directory in FTP server
echo CD x >> "%ftpfile%"//If the server has configured the FTP upload file rem echo cd x >> "%ftpfile%" comment on the line
REM------------------------------
REM enters the local C-packing directory
echo LCD c:\ >> "%ftpfile%"
REM------------------------------
Echo put A.TXT >> "%ftpfile%"
Echo quit >> "%ftpfile%"
echo-------------------------------->> "%logfile%"
date/t >> "%logfile%"
time/t >> "%logfile%"
echo-------------------------------->> "%logfile%"
Ftp-n < "%ftpfile%" >> "%logfile%"
Del "%ftpfile%"
@echo on
rem-----------Script End---------------
The above is a small series to introduce the batch processing FTP upload file problem, I hope to help you!