1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
|
@echo off
REM -------------------------------------------------------------------
REM --- CheckDat.bat
REM -------------------------------------------------------------------
@SET server=fralsamisips02
@SET sdat=None
@SET seng=None
@SET svdate=None
@SET xdat=None
@SET xeng=None
@SET xvdate=None
@SET datkey=None
REM -------------------------------------------------------------------
REM ----------------- DAT Version From This Computer -----------------
REM -------------------------------------------------------------------
REM Engine Version
REM -------------------------------------------------------------------
@echo EngineVersion32Major None None > c:\nsclientplus\scripts\%1_temp.txt
@c:\nsclientplus\scripts\REG.exe QUERY "HKLM\SOFTWARE\McAfee\AVEngine" /v EngineVersion32Major > c:\nsclientplus\scripts\%1_temp.txt
@FOR /f "tokens=3 delims= " %%a IN (c:\nsclientplus\scripts\%1_temp.txt) do set seng=%%a
REM -------------------------------------------------------------------
REM Dat File Version
REM -------------------------------------------------------------------
@echo AVDatVersion None None > c:\nsclientplus\scripts\%1_temp.txt
@c:\nsclientplus\scripts\REG.exe QUERY "HKLM\SOFTWARE\McAfee\AVEngine" /v AVDatVersion > c:\nsclientplus\scripts\%1_temp.txt
@FOR /f "tokens=3 delims= " %%a IN (c:\nsclientplus\scripts\%1_temp.txt) do set sdat=%%a
REM -------------------------------------------------------------------
REM Dat Date
REM -------------------------------------------------------------------
@ECHO AVDatDate None None > c:\nsclientplus\scripts\%1_temp.txt
@c:\nsclientplus\scripts\REG.exe QUERY "HKLM\SOFTWARE\McAfee\AVEngine" /v AVDatDate > c:\nsclientplus\scripts\%1_temp.txt
@FOR /f "tokens=3,4,5 delims= " %%a IN (c:\nsclientplus\scripts\%1_temp.txt) do set svdate=%%a-%%b-%%c
REM
REM -------------------------------------------------------------------
REM ---------------- DAT Version From The Main Server ----------------
REM -------------------------------------------------------------------
@SET machine=\\%server%
REM -------------------------------------------------------------------
REM Engine Version
REM -------------------------------------------------------------------
@ECHO szEngineVer None None > c:\nsclientplus\scripts\%server%_temp.txt
@c:\nsclientplus\scripts\REG.exe QUERY "%machine%\HKLM\SOFTWARE\Network Associates\TVD\VirusScan Enterprise\CurrentVersion" /v szEngineVer > c:\nsclientplus\scripts\%server%_temp.txt
@FOR /f "tokens=3 delims= " %%a IN (c:\nsclientplus\scripts\%server%_temp.txt) do set xeng=%%a
REM -------------------------------------------------------------------
REM Dat File Version
REM -------------------------------------------------------------------
@ECHO szVirDefVer None None > c:\nsclientplus\scripts\%server%_temp.txt
@c:\nsclientplus\scripts\REG.exe QUERY "%machine%\HKLM\SOFTWARE\Network Associates\TVD\VirusScan Enterprise\CurrentVersion" /v szVirDefVer > c:\nsclientplus\scripts\%server%_temp.txt
@FOR /f "tokens=3 delims= " %%a IN (c:\nsclientplus\scripts\%server%_temp.txt) do set xdat=%%a
REM -------------------------------------------------------------------
REM Dat Date
REM -------------------------------------------------------------------
@ECHO szVirDefDate None None > c:\nsclientplus\scripts\%server%_temp.txt
@c:\nsclientplus\scripts\REG.exe QUERY "%machine%\HKLM\SOFTWARE\Network Associates\TVD\VirusScan Enterprise\CurrentVersion" /v szVirDefDate > c:\nsclientplus\scripts\%server%_temp.txt
@FOR /f "tokens=3,4,5 delims= " %%a IN (c:\nsclientplus\scripts\%server%_temp.txt) do set xvdate=%%a-%%b-%%c
REM -------------------------------------------------------------------
REM Convert to version only if necessary
REM -------------------------------------------------------------------
@SET datkey=%sdat:~1,1%
@IF NOT %datkey%==. GOTO PASCONV1
@SET sdat=%sdat:~4,4%%
:PASCONV1
@SET datkey=%xdat:~1,1%
@IF NOT %datkey%==. GOTO PASCONV2
@SET xdat=%xdat:~4,4%
:PASCONV2
REM ---------------------------------------------------------------------
REM ---- Cleanup
REM ---------------------------------------------------------------------
@DEL c:\nsclientplus\scripts\_temp.txt
@DEL c:\nsclientplus\scripts\%server%_temp.txt
REM ---------------------------------------------------------------------
@IF NOT %sdat%==%xdat% GOTO NOTOK
@IF NOT %seng%==%xeng% GOTO NOTOK
@echo OK %date% %time% found : %seng% / %sdat% / %svdate% (ref:%server% %xeng% %xdat% %xvdate%)
@exit 0
:NOTOK
@echo CRITICAL %date% %time% found : %seng% / %sdat% / %svdate% (ref:%server% %xeng% %xdat% %xvdate%)
@exit 2 |
Partager