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
| @echo off
REM -------------------------------------------------------------------
REM --- CheckDat.bat
REM -------------------------------------------------------------------
@SET sdat=None
@SET seng=None
@SET svdate=None
@set /A J=%date:~5,2%
@set /a M=%date:~8,2%
@set /a A=%date:~11,4%
@SET datkey=None
REM -------------------------------------------------------------------
REM -------- DAT Version From This Computer --------------
REM -------------------------------------------------------------------
REM ---- Engine Version
REM -------------------------------------------------------------------
@echo szEngineVer None None > c:\nsclientplus\scripts\%1_temp.txt
@c:\nsclientplus\scripts\REG.exe QUERY "HKLM\SOFTWARE\Network Associates\TVD\VirusScan Enterprise\CurrentVersion" /v szEngineVer > 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 szVirDefVer None None > c:\nsclientplus\scripts\%1_temp.txt
@c:\nsclientplus\scripts\REG.exe QUERY "HKLM\SOFTWARE\Network Associates\TVD\VirusScan Enterprise\CurrentVersion" /v szVirDefVer > 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 szVirDefDate None None > c:\nsclientplus\scripts\%1_temp.txt
@c:\nsclientplus\scripts\REG.exe QUERY "HKLM\SOFTWARE\Network Associates\TVD\VirusScan Enterprise\CurrentVersion" /v szVirDefDate > 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 ---- Date Reference
REM -------------------------------------------------------------------
REM ...
REM ...
REM ---------------------------------------------------------------------
REM ---- Cleanup
REM ---------------------------------------------------------------------
@DEL c:\nsclientplus\scripts\_temp.txt
REM ---------------------------------------------------------------------
REM ----------------------------- Test----------------------------------
REM ---------------------------------------------------------------------
@IF NOT %date%==%dateref% goto NOTOK
@echo OK %date% %time% found : %seng% / %sdat% / %svdate%
@exit 0
:NOTOK
@echo CRITICAL %date% %time% found : %seng% / %sdat% / %svdate%
@exit 2 |
Partager