(view source code of savver.bat as plain text)
@ECHO OFF
IF NOT "%OS%"=="Windows_NT" GOTO Syntax
SETLOCAL ENABLEDELAYEDEXPANSION
SET Ping=1
IF NOT "%~1"=="" (
ECHO.%* | FINDSTR /R /C:"[/?:;]" >NUL && GOTO Syntax
PING %~1 -n 2 2>NUL | FIND "TTL=" >NUL || SET Ping=0
SET ProgramFiles=\\%~1\C$\Program Files
SET ComputerName=%~1
CALL :UpCase ComputerName
)
IF %Ping% EQU 1 (
SET DefsDir=%ProgramFiles%\Common Files\Symantec Shared\VirusDefs
FOR /R "%ProgramFiles%" %%A IN (rtvscan.exe) DO IF EXIST "%%~A" (
FOR /F "tokens=5" %%A IN ('FILEVER "%%~A"') DO SET SAVVer=%%A
FOR /D %%A IN ("%DefsDir%\20*.*") DO SET SAVDef=%%~nxA
)
ECHO.%ComputerName% !SAVVer! !SAVDef!
) 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 SAVVer.bat, Version 1.00 for Windows 2000 and later
1>&2 ECHO Return the version of Symantec AntiVirus and its virus definitions
1>&2 ECHO.
1>&2 ECHO Usage: SAVVER [ 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 Kits.
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.0072 seconds