MrPurple Development

Development, Games and more …

@ECHO off
setLocal EnableDelayedExpansion

:: Local directory
DIR /b E:FTP > FileList.txt

:: Set FTP configuration and get a list of files on the FTP
> FTP.do ECHO o Server
>> FTP.do ECHO User
>> FTP.do ECHO Passwort
>> FTP.do ECHO ls FTPFolder FTPList.txt
>> FTP.do ECHO bye

:: Run the FTP script
ftp -s:FTP.do

:: Set FTP configuration
> FTP.do ECHO o Server
>> FTP.do ECHO User
>> FTP.do ECHO Passwort
>> FTP.do ECHO cd Folder
>> FTP.do ECHO lcd local_folder
>> FTP.do ECHO prompt

:: Add files you don’t already have
For /f “tokens=* delims=” %%a in (FTPList.txt) Do (
FindSTR /C:%%a FileList.txt
if errorlevel 1 (
ECHO get %%a >> FTP.do
) else (
ECHO %%a is already there
)
)

>> FTP.do ECHO bye

:: Run the FTP script
ftp -s:FTP.do

:: Delete files
del FTP.do
del FileList.txt
del FTPList.txt

CLS

December 7th, 2010

Posted In: Uncategorized

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.