I have been needing to do this for a while now. Well, quite a while now (since 2000). This was originally done as a batch script.

Re: McAfee VirusScan .dat updater

The following is needed to complete this task:
FTPCHeck.KIX > The KiX script

LOGIN.SC > The following FTP code is used to login and gather the the dat to check.
anonymous
user@domain.com
cd pub/datfiles/english/
ls *.zip c:\new
bye


NEW > File Generated during the FTP Process
OLD > File Copied when there is a change and is compared to

NEWFILES.SC > The following FTP code is used to go get the new DAT/SDAT/etc.
anonymous
user@domain.com
cd /pub/antivirus/datfiles/4.x
::Turn Prompting off - Needed for Microsoft FTP clients. UNIX should be turned off.
prompt
Mget sdat*.*
Mget dat*.zip
Mget dat*.tar
get update.ini
get delta.ini
bye


Now, for the script:
CLS
BREAK ON
DIM $,$old,$new,$Recipients,$subject,$msg
$x =SETOPTION('WrapAtEOL','On')
$rc=SETOPTION('Explicit','On')
$rc=SETOPTION('NoVarsInStrings','On')
$rc=SETOPTION('CaseSensitivity','On')
; - Original Date - 12/20/2000
; - Kent Dyer
; - ~6/5/01 Added in components to download files when changed
; WHAT IS THIS? This is a batch file created when we wanted to see when the SuperDATs have changed on ftp.nai.com
; Originally posted at - http://infocenter.cramsession.com/articles/files/check-if-ftp-file-has-cha-9262003-0830.asp
; WRITTEN FOR NT/2K.
; The following files are needed:
; FTPCHECK.kix - main Kix File.
; login.sc - FTP Script file.
; newfiles.sc - FTP Script file to get new files.
; new - file created during FTP Session.
; old - file to compare to.
; POSTIE.EXE - From - http://www.infradig.com/infradig/postie/download.shtml you could use BLAT in it's place.

IF @DOS < 4
?"This only works with Windows NT/2000/XP... Sorry"
SLEEP 2
QUIT
ENDIF

;FTP into the site using a script
debug on
SHELL 'ftp -s:login.sc ftp.nai.com'

;Create variables to check
$=Open(1,'c:\new')
$new=ReadLine(1)
$=Open(2,'c:\old')
$old=ReadLine(2)
$=close(1)
$=close(2)

IF $new=$old
QUIT
ELSE
?'FILES ARE NOT EQUAL'
SHELL 'ftp -s:newfiles.sc ftp.nai.com'
;Send an alert
$Recipients='user@domain.com,user1@domain.com'
$subject='DAT Update has arrived.'
$msg=$new+' has arrived at Network Associates'
?'File being replaced'
SHELL 'postie.exe -host:smtp.server.com -to:'+$Recipients+' -from:"DATCheck" -s:"'+$subject+'" -msg:"'+$msg+'"'
;The file is newer and copy to new so we don't get told about it till the next update
COPY @scriptdir+'\new' @scriptdir+'\old'
ENDIF


We have been using this for four years and sorry that I have not converted it to KiX until now. I am open to suggestions, improvements, etc.

Thanks,

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's