Batch application: checking McAfee superdat updates using FlashGet


Because I made a script, I used McAfee   Superdat for drug detection( )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   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” 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   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 

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 

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