Medanese IT Geek, movie lover and (mostly) law-abiding citizen. Dreaming of cheap and easy access to ICT, healthcare and education in Indonesia.



Downloading McAfee ViruScan Virus Definition using Batch script and Wget

Category: Tips and Tricks — kamaruddin @ 9:40 am

Have you encounter this situation in your office? You have to keep all workstations with McAfee ViruScan updated with latest definition but only the lucky few are entitled for web access. Unlike Avira Antivir, McAfee is not using static filename for its virus definition (ie. sdatXXXX.exe) and is incrementing everyday. Using a download manager won’t work since its dynamic naming nature.

Here’s where the good old buddy WGET and batch script come in rescue.

@echo off
set TargetPath=D:\Antivirus

IF EXIST "%TargetPath%\update.ini" del "%TargetPath%\update.ini"
wget -O "%TargetPath%\update.ini"

FOR /f "tokens=2 delims==" %%a in ('type "%TargetPath%\update.ini" ^| find /i "datversion="') DO SET DatVersion=%%a

REM // If you can get it by FTP remove the REM otherwise use HTTP
REM wget -O "%TargetPath%\sdat%DatVersion%.exe"

wget -O "%TargetPath%\sdat%DatVersion%.exe"

IF EXIST "%TargetPath%\old.exe" del "%TargetPath%\old.exe"
REN %targetpath%\update.exe old.exe
REN %targetpath%\sdat%DatVersion%.exe update.exe


If you can’t download via FTP as some crappy ISP disabled it for reasons, you’ll have much luck with HTTP.

Scheduled it into your computer/server (Task Scheduler) and have it ready warm and fresh the next morning. Bye-bye manual downloading….

• • •
Using modified "Sitepoint-like" Theme. kamaruddin [-at-] gmail *dot* com