Jump to content

How to locate/extract a filename in a remote FTP directory

Recommended Posts

A big Hi to all the AutoIt forum users.

I'm trying to build a sort of autoupdater for the McAfee command line antivirus. To be updated, I need to get the lates DAT file stored at:


The DAT file is usually daily updated and file name is incremental, yesterday was dat-4625.zip, today is dat-4626 etc.

Since InetGet don't allow wilcards (es: dat-*.zip) how to extract/locate the name of the currently DAT on-line and pass it to Inetget ?

Thanking in advance for any help or advice.


Link to post
Share on other sites


Near the end of the thread wouter mentions a few things about how to step through the files...

[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

Link to post
Share on other sites


I do it every day with a dos Batch file.

I´m interested to release it with autoit, but I don´t know a FTPFINDFileFirst commandwith AUTOIT.

I Hope W0uter will implement ist, because he has written the first FTP UDF Files like FTP_PUT (and nessesary Functions)

For the first Time you try it with _rundos("NAME.BAT")

Here my DOS-BAT file for _Rundos()

Sorry, the comments are in German

It creates a ini file for using with DOS-FTP Command

@echo off
TITLE automatisches Virenupdate
md c:\Symantec_virusupdate
md c:\Symantec_virusupdate\download

echo cd /public/english_us_canada/antivirus_definitions/norton_antivirus >c:\Symantec_virusupdate\ftp.ini
ls 200*i32.exe c:\temp\tmp_ftp.txt >>c:\Symantec_virusupdate\ftp.ini
quit >>c:\Symantec_virusupdate\ftp.ini

REM Downloadnamen für Virenupdate filtern (2004xxxx-00x-i32.exe)
ftp  -s:c:\Symantec_virusupdate\ftp.ini -A ftp.symantec.com
type c:\tmp_ftp.txt |find "i32.exe" >c:\tmp_dir.txt
FOR /F "tokens=1,2 delims=" %%i IN (c:\tmp_dir.txt) DO set NAV_DOWNLOAD=%%i
ECHO Download laeuft.....

REM Download Verzeichnis Leeren
del /q c:\Symantec_virusupdate\download\*.*

echo LCD c:\Symantec_virusupdate\download >c:\Symantec_virusupdate\ftp_down.ini
echo cd /public/english_us_canada/antivirus_definitions/norton_antivirus >>c:\Symantec_virusupdate\ftp_down.ini
echo get %NAV_DOWNLOAD% >>c:\Symantec_virusupdate\ftp_down.ini
echo quit >>c:\Symantec_virusupdate\ftp_down.ini
ftp  -s:c:\Symantec_virusupdate\ftp_down.ini -A ftp.symantec.com

echo Download von %NAV_DOWNLOAD% nach c:\Symantec_virusupdate\download\%NAV_DOWNLOAD% 
ECHO Uebertragung kann 2-3 Minuten dauern......

REM run downloaded file

I hope this is helpfull for you



Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...