@echo off
echo.
echo ==================================================
echo FLASHGET download detection script to automatically update MCAFEE SUPERDAT
echo created by scz 20061102
echo ==================================================
rem Please use FLASHGET’s virus detection function and specify it as this script
rem mainly uses FLASHGET to download and update pages.
rem Let FLASHGET1.5 or above version download update page regularly: "E:\Program Files\FlashGet\" /apps/downloads/security_updates/?region=cn&segment=enterprise f:\bak\checkMcafee
rem is equipped with a flashget for virus detection. After downloading, this script will be run and then automatically updated SupperDat
rem and then redownload the page regularly
rem The path, file name and extension to the file download
set filepath=%~dp1
set filename=%~n1
set fileExt=%~x1
rem FLASHGET path
set FLASHGET="E:\Program Files\FlashGet\"
rem SuperDat storage path
set datPath=f:\bak\update\
Rem checked asp page storage path
set aspPath=f:\bak\checkMcafee\
rem string comparison
echo.
echo check the downloaded file format and location...
(echo -%filepath%- | find /i "-%datPath%-" >nul) && (echo -%filename%- | find /i "-sdat" >nul) && (echo -%fileExt%- | find /i "-.exe-" >nul) && goto checkdat
(echo -%filepath%- | find /i "-%aspPath%-" >nul) && (echo -%filename%%fileExt%- | find /i "--" >nul) && goto checkasp
echo Download to file: %filepath%%%filename%%fileExt%, no processing required
goto end
:checkdat
echo.
echo Download to SuperDat: %filename%%fileExt%, processing...
cd /d %datPath%
ren %filename%%fileExt% McAfee.%filename%%fileExt%
echo Delete the old version of SuperDat...
for /f "skip=1" %%i in ('dir mcafee*.exe /tc /o-d /b 2^>nul') do (del %%i)
echo Notice to release MCAFEE SUPERDAT...
start "" McAfee.%filename%%fileExt% /e c:\mcafee
echo SuperDat has been processed.
goto end
:checkasp
echo.
echo Download to...
set url=
set sdatname=
cd /d f:\bak\checkMcafee
echo analysis...
for /f "tokens=3,4* delims=<>=" %%i in ('type ^| find "simplified/sdat"') do (set url=%%i & set sdatname=%%j)
set ver0=%sdatname:sdat=%
set ver1=%ver0:.exe=%
echo analysis results: SUPPERDAT version number is %ver1%
cd /d %datPath%
if exist %sdatname% ren %sdatname% McAfee.%sdatname%
if exist mcafee.%sdatname% (echo The latest version already exists &goto end) else (echo This version has not been downloaded, notify FLASHGET to download &start "" %FLASHGET% %url% %datPath%)
goto end
:end
echo.
pause