download/update script for antivirus definitions

April 12, 2012 at 23:52:07
Specs: Windows 7
I'm currently trying to automate my updates for Symantec Endpoint Protection.
My objective is to download, via ftp, the latest definitions. (I have other computers on the network which will be looking at my computer for the file as they dont have internet access)

My current script looks like this (please keep in mind, I'm an amateur scripter):

open ftp.symantec.com
anonymous
nobody@spammer.com
cd AVDEFS/norton_antivirus/ C:\Symantec Updates\Update Files\
bin
hash
prompt
dir *-v5i32.exe
mget *-v5i32.exe
bye

This is the output from dir *-v5i32.exe

-rw-rw-r-- 1 1994 1994 154483784 Apr 10 14:45 20120410-003-v5i32.exe
-rw-rw-r-- 1 1994 1994 154529344 Apr 10 23:10 20120410-020-v5i32.exe
-rw-rw-r-- 1 1994 1994 154584792 Apr 11 07:12 20120410-036-v5i32.exe
-rw-rw-r-- 1 1994 1994 154586208 Apr 11 13:31 20120411-003-v5i32.exe
-rw-rw-r-- 1 1994 1994 154576576 Apr 11 23:04 20120411-019-v5i32.exe
-rw-rw-r-- 1 1994 1994 154642800 Apr 12 04:48 20120411-034-v5i32.exe
-rw-rw-r-- 1 1994 1994 154692744 Apr 12 13:43 20120412-001-v5i32.exe
-rw-rw-r-- 1 1994 1994 154653312 Apr 12 22:56 20120412-018-v5i32.exe
-rw-rw-r-- 1 1994 1994 154758288 Apr 13 05:08 20120412-032-v5i32.exe

Seeing as Symantec add a new file daily, Is there a way i can just download the latest file?
Any help will be greatly appreciated


See More: download/update script for antivirus definitions

Report •

#1
July 18, 2012 at 07:54:55
I think the problem lies in their naming structure. If there wasn't a change in the three didget, you might be able to wild card it using today's %date% variable. However, I am not sure if there is an easy way to skip past the ??? before the -v5i32.exe

:: mike


Report •

#2
July 18, 2012 at 12:05:23
Below is a script I wrote for someone else (maybe you?) that does this.

@echo off
if exist _.ftp >nul del _.ftp
>_.ftp echo open ftp.symantec.com
>>_.ftp echo anonymous
>>_.ftp echo anon@abc.com
>>_.ftp echo cd AVDEFS/norton_antivirus/ .
>>_.ftp echo bin
>>_.ftp echo hash
>>_.ftp echo prompt
>>_.ftp echo dir *-v5i32.exe
>>_.ftp echo bye
for /f "tokens=9" %%i in (
'ftp -s:_.ftp'
) do (
set file=%%i
)
>_.ftp echo open ftp.symantec.com
>>_.ftp echo anonymous
>>_.ftp echo anon@abc.com
>>_.ftp echo cd AVDEFS/norton_antivirus/ .
>>_.ftp echo bin
>>_.ftp echo hash
>>_.ftp echo prompt
>>_.ftp echo get %file%
>>_.ftp echo bye
ftp -s:_.ftp
>nul del _.ftp

Tony


Report •
Related Solutions


Ask Question