@echo off echo. echo ================================================== echo FLASHGET下载检测脚本,用来自动更新MCAFEE SUPERDAT echo created by scz 20061102 echo ================================================== rem 请使用FLASHGET的病毒检测功能,指定为该脚本 rem 主要使用FLASHGET下载更新页面时使用 rem 让FLASHGET1.5以上版本定时下载更新页面:"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,下载完后就会运行此脚本,然后自动更新SupperDat rem 然后定期重新下载页面即可
rem 下载到文件的路径、文件名和扩展名 set filepath=%~dp1 set filename=%~n1 set fileExt=%~x1
rem FLASHGET路径 set FLASHGET="E:/Program Files/FlashGet/flashget.exe"
echo 下载到文件:%filepath%%filename%%fileExt%,不需要处理 goto end
:checkdat echo. echo 下载到SuperDat: %filename%%fileExt%,处理中... cd /d %datPath% ren %filename%%fileExt% McAfee.%filename%%fileExt% echo 删除老版SuperDat... for /f "skip=1" %%i in ('dir mcafee*.exe /tc /o-d /b 2^>nul') do (del %%i) echo 通知释放MCAFEE SUPERDAT... start "" McAfee.%filename%%fileExt% /e c:/mcafee echo SuperDat处理完毕. goto end
:checkasp echo. echo 下载到superdat.asp... set url= set sdatname= cd /d f:/bak/checkMcafee echo 分析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 分析结果:SUPPERDAT版本号为%ver1%
cd /d %datPath% if exist %sdatname% ren %sdatname% McAfee.%sdatname% if exist mcafee.%sdatname% (echo 已存在最新版本 &goto end) else (echo 该版本未下载,通知FLASHGET下载 &start "" %FLASHGET% %url% %datPath%) goto end