How to achieve a directory of several files automatically uploaded FTP upload files only have file attributes, and then FTP uploaded successfully after the successful automatic removal (this machine) just uploaded files of the archive attributes, batch processing can be achieved? Somewhat similar to the feature of incremental backups of files.
@echo off
rem Specifies the FTP user name
set ftpuser=ftpusername
rem Specifies the ftp password
set Ftppass=ftppassword
rem Specify the FTP server address set
ftpip=192.168.0.2
set the local folder directory to upload set
srcfolder=c:/test
dir/b/aa-d>nul 2>nul
if%errorlevel% equ 1 (
echo No archiving file to FTP
pause
goto:eof
)
set ftpfile=%temp% /tempftp.txt
> "%ftpfile%" echo,%ftpuser%
>> "%ftpfile%" echo,%ftppass%
>> "%ftpfile% "Echo Bin
for/f" tokens=* "%%a in (' dir/b/aa-d ') does (
>>"%ftpfile% "Echo put"%srcfolder%/%%a "
) C22/>>> "%ftpfile%" echo bye
start ftp-v-i-s: "%ftpfile%"%ftpip% ping-n-127.1>nul
*.*