(view source code of avg8ver.bat as plain text)
@ECHO OFF
IF NOT "%OS%"=="Windows_NT" GOTO Syntax
SETLOCAL ENABLEDELAYEDEXPANSION
SET Ping=1
SET RegKey=HKLM\SOFTWARE\AVG\Avg8
IF NOT "%~1"=="" (
ECHO.%* | FINDSTR /R /C:"[/?:;]" >NUL && GOTO Syntax
PING %~1 -n 2 2>NUL | FIND "TTL=" >NUL || SET Ping=0
SET ComputerName=%~1
CALL :UpCase ComputerName
SET ProgramFiles=\\!ComputerName!\C$\Program Files
SET RegKey=\\!ComputerName!\%RegKey%
)
IF %Ping% EQU 1 (
FOR /F "tokens=2*" %%A IN ('REG Query "%RegKey%" /V AvgDir 2^>NUL') DO SET AvgDir=%%~B
FOR /F "tokens=2*" %%A IN ('REG Query "%RegKey%" /V AvgAllUsersDir 2^>NUL') DO SET AvgLog=%%~B\Log\avgupd.log
FOR /F "tokens=5" %%A IN ('FILEVER "!AvgDir!\avgscan*.exe"') DO SET AVGVer=%%A
FOR /F "tokens=9* delims=:" %%A IN ('TYPE "!AvgLog!" ^| FIND "Last-Modified:" ^| FIND ".Thread1]"') DO (
FOR /F "tokens=1 delims=^|'" %%C IN ("%%~B") DO (
FOR /F "tokens=1*" %%D IN ("%%~C") DO (
SET AVGDef=%%E
)
)
)
ECHO.%ComputerName% !AVGVer! !AVGDef!
) ELSE (
ECHO.%ComputerName%
)
ENDLOCAL
GOTO:EOF
:UpCase
:: Converts a variable VALUE to all upper case.
:: The argument for this subroutine is the variable NAME.
SET %~1=!%1:a=A!
SET %~1=!%1:b=B!
SET %~1=!%1:c=C!
SET %~1=!%1:d=D!
SET %~1=!%1:e=E!
SET %~1=!%1:f=F!
SET %~1=!%1:g=G!
SET %~1=!%1:h=H!
SET %~1=!%1:i=I!
SET %~1=!%1:j=J!
SET %~1=!%1:k=K!
SET %~1=!%1:l=L!
SET %~1=!%1:m=M!
SET %~1=!%1:n=N!
SET %~1=!%1:o=O!
SET %~1=!%1:p=P!
SET %~1=!%1:q=Q!
SET %~1=!%1:r=R!
SET %~1=!%1:s=S!
SET %~1=!%1:t=T!
SET %~1=!%1:u=U!
SET %~1=!%1:v=V!
SET %~1=!%1:w=W!
SET %~1=!%1:x=X!
SET %~1=!%1:y=Y!
SET %~1=!%1:z=Z!
GOTO:EOF
:Syntax
1>&2 ECHO.
1>&2 ECHO AVG8Ver.bat, Version 1.00 for Windows 2000 and later
1>&2 ECHO Return the version of AVG8 AntiVirus and its virus definitions
1>&2 ECHO.
1>&2 ECHO Usage: AVG8VER [ remote_computer ]
1>&2 ECHO.
1>&2 ECHO Where: remote_computer is an optional computer name;
1>&2 ECHO (default is the local computer)
1>&2 ECHO.
1>&2 ECHO Note: Requires FILEVER.EXE from one of the Windows Resource
1>&2 ECHO Kits, and REG.EXE version 3.0 (native in Windows XP).
1>&2 ECHO.
1>&2 ECHO Written by Rob van der Woude
1>&2 ECHO http://www.robvanderwoude.com
IF "%OS%"=="Windows_NT" ENDLOCAL
page last modified: 2024-04-16; loaded in 0.0064 seconds