Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I wrote this because I couldn't find anything better out there... but I learned a lot from these forums, especially M2. Here it is, a script to synch with the FTP. Are there any pointers or improvements anyone could suggest?
@ECHO off
setLocal EnableDelayedExpansion:: Local directory
DIR /b [Loacal download direcotry] > FileList.txt:: Set FTP configuration and get a list of files on the FTP
> FTP.do ECHO o [FTP Server]
>> FTP.do ECHO [username]
>> FTP.do ECHO [password]
>> FTP.do ECHO ls [add a directory here if you need to if youre not downloading from the root driectory] FTPList.txt
>> FTP.do ECHO bye:: Run the FTP script
ftp -s:FTP.do:: Set FTP configuration
> FTP.do ECHO o [FTP Server]
>> FTP.do ECHO [username]
>> FTP.do ECHO [password]
>> FTP.do ECHO cd [add a directory here if you need to if youre not downloading from the root driectory, if not, remove this line]
>> FTP.do ECHO lcd [Loacal download direcotry]
>> 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.txtCLS

At first reading, looks like you've done it very well. Nothing I can see that needs fixing.
=====================================
If at first you don't succeed, you're about average.M2

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |