cd %temp%
if not exist McAfee\nul md McAfee
cd McAfee
if exist gdeltaavv.ini del gdeltaavv.ini
wget http://update.nai.com/products/commonupdater/gdeltaavv.ini
if not exist gdeltaavv.ini goto error1
for /F "usebackq skip=2 delims== tokens=1,2*" %%m in (`Find /I "CurrentVersion" gdeltaavv.ini`) do set Curr=%%n
if exist sdat%Curr%.exe goto fin
del *.exe
wget http://download.nai.com/products/licensed/superdat/english/intel/sdat%Curr%.exe
if not exist sdat%Curr%.exe goto error2
sdat%Curr%.exe /silent
goto fin
:error1
echo Cannot retrieve gdeltaavv.ini
goto fin
:error2
echo Cannot retrieve sdat%Curr%.exe
goto fin
:fin
cd %temp%
if not exist McAfee\nul md McAfee
cd McAfee
if exist gdeltaavv.ini del gdeltaavv.ini
rem We get the .ini file where the newest version of DAT file is stored
wget http://update.nai.com/products/commonupdater/gdeltaavv.ini
if not exist gdeltaavv.ini goto error1
rem We extract the newest version level from that file, as a decimal number
for /F "usebackq skip=2 delims== tokens=1,2*" %%m in (`Find /I "CurrentVersion" gdeltaavv.ini`) do set Curr=%%n
echo Newest DAT level on McAfee's site is %Curr%
rem We get the current version of DAT file on the local computer (from its registry)
reg query HKLM\SOFTWARE\McAfee\AVEngine /v AVDatVersion > %temp%\McAfee\regqvv.txt
rem We extract the actual version as a decimal number and store it in "LocCurrDec" environment variable
for /F "skip=4 delims=x tokens=2,*" %%m in (regqvv.txt) do set /A LocCurrDec = 0x%%m
if %LocCurrDec% == %Curr% goto fin
if exist sdat%Curr%.exe goto fin
del *.exe
wget http://download.nai.com/products/licensed/superdat/english/intel/sdat%Curr%.exe
if not exist sdat%Curr%.exe goto error2
sdat%Curr%.exe /silent
goto fin
:error1
echo Cannot retrieve gdeltaavv.ini
goto fin
:error2
echo Cannot retrieve sdat%Curr%.exe
goto fin
:fin
Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.
Comments (0)