Batch application: checking McAfee superdat updates using FlashGet

Time:2021-10-24

Because I made a script, I used McAfee   Superdat for drug detection( http://blog.csdn.net/scz123/archive/2006/11/02/1362566.aspx )However, when the virus code is updated, it must be manually downloaded from the website. This script is built and run by using the virus check function after FlashGet download, so as to automatically check and download McAfee   The function of superdat update.

Copy codeThe code is as follows:
@echo off 
echo. 
echo ================================================== 
echo   FlashGet downloads the detection script to automatically update McAfee   SUPERDAT  
echo created by scz 20061102 
echo ================================================== 
rem   Please use the virus detection function of FlashGet to specify it as the script  
rem   It is mainly used when downloading and updating pages using FlashGet  
rem   Let flashget1.5 and above regularly download the update page: “E: \ program”   Files\FlashGet\flashget.exe”   http://www.mcafee.com/apps/downloads/security_ updates/superdat.asp?region=cn&segment=enterprise   f:\bak\checkMcafee  
rem   FlashGet with only virus detection will run this script after downloading, and then automatically update supplerdat  
rem   Then download the page again regularly  

rem   The path, file name, and extension to download to the file  
set filepath=%~dp1 
set filename=%~n1 
set fileExt=%~x1 

rem   FlashGet path  
set FLASHGET=”E:\Program Files\FlashGet\flashget.exe” 

rem   Superdat storage path  
set datPath=f:\bak\update\ 

rem   Check the storage path of ASP pages  
set aspPath=f:\bak\checkMcafee\ 

rem   string comparison  
echo. 
echo   Check the format and location of downloaded files  
(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 “-superdat.asp-” >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 old superdat  
for /f “skip=1” %%i in (‘dir mcafee*.exe /tc /o-d /b 2^>nul’) do (del %%i) 
echo   Notify release of McAfee   SUPERDAT…  
start “” McAfee.%filename%%fileExt% /e c:\mcafee 
echo   Superdat finished processing  
goto end 

:checkasp 
echo. 
echo   Download to superdat.asp  
set url= 
set sdatname= 
cd /d f:\bak\checkMcafee 
echo   Analyze superdat.asp  
for /f “tokens=3,4* delims=<>=” %%i in (‘type superdat.asp ^| find “simplified/sdat”‘) do (set url=%%i & set sdatname=%%j) 
set ver0=%sdatname:sdat=% 
set ver1=%ver0:.exe=% 
echo   Analysis result: suppldat 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 is not downloaded. Notify FlashGet to download  & start   “”  % FLASHGET%  % url%  % datPath%)  
goto end 

:end 
echo. 
pause