Computing.Net > Forums > Programming > ftp get latest D*.zip

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

ftp get latest D*.zip

Reply to Message Icon

Name: Mechanix2Go
Date: June 7, 2007 at 17:13:26 Pacific
OS: w2k sp3
CPU/Ram: PIII 933/256MB
Product: brand x
Comment:

If the site holds zip[s] named DYYMMDD.zip, this will get the latest one.

::==
@echo off > mydir.ftp
setLocal EnableDelayedExpansion

>> mydir.ftp echo o mysite.com
>> mydir.ftp echo username
>> mydir.ftp echo password
>> mydir.ftp echo cd mysite.com
>> mydir.ftp echo ls D*.zip
>> mydir.ftp echo bye

ftp -s:mydir.ftp > mydir.txt

for /f "tokens=* delims= " %%a in ('find ".zip" ^< mydir.txt ^| find /v "ls D*.zip" ^| sort') do (
set str=%%a
set latest=!str:~0,-1!
)

> getzip.ftp echo o mysite.com
>> getzip.ftp echo username
>> getzip.ftp echo password
>> getzip.ftp echo cd mysite.com
>> getzip.ftp echo bin
>> getzip.ftp echo get !latest!
>> getzip.ftp echo bye

ftp -s:getzip.ftp
::==


=====================================
If at first you don't succeed, you're about average.

M2




Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


I need help Batch file for renaming f...



Post Locked

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


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: ftp get latest D*.zip

append a number tonew file created www.computing.net/answers/programming/append-a-number-tonew-file-created/15765.html

Append a number to filename www.computing.net/answers/programming/append-a-number-to-filename/15782.html

Escape Command www.computing.net/answers/programming/escape-command/16052.html