Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for viprever.bat

(view source code of viprever.bat as plain text)

  1. @ECHO OFF
  2. IF NOT "%OS%"=="Windows_NT" GOTO Syntax
  3.  
  4. SETLOCAL ENABLEDELAYEDEXPANSION
  5. SET Ping=1
  6. IF NOT "%~1"=="" (
  7. 	ECHO.%* | FINDSTR /R /C:"[/?:;]" >NUL && GOTO Syntax
  8. 	PING %~1 -n 2 2>NUL | FIND "TTL=" >NUL || SET Ping=0
  9. 	SET ProgramFiles=\\%~1\C$\Program Files
  10. 	SET ComputerName=%~1
  11. 	CALL :UpCase ComputerName
  12. )
  13. IF %Ping% EQU 1 (
  14. 	FOR /F "tokens=*" %%A IN ('"%ProgramFiles%\Sunbelt Software\VIPRE\SBAMCommandLineScanner.exe"/displayvipreversion') DO SET VipreVer=%%A
  15. 	FOR /F "tokens=*" %%A IN ('"%ProgramFiles%\Sunbelt Software\VIPRE\SBAMCommandLineScanner.exe" /displaylocaldefversion') DO (
  16. 		FOR /F "tokens=1,2*" %%B IN ("%%~A") DO (
  17. 			SET VipreDef=%%D %%B
  18. 		)
  19. 	)
  20. 	SET VipreDef=!VipreDef:T= !
  21. 	ECHO.%ComputerName%	!VipreVer!	!VipreDef!
  22. ) ELSE (
  23. 	ECHO.%ComputerName%
  24. )
  25. ENDLOCAL
  26. GOTO:EOF
  27.  
  28.  
  29. :UpCase
  30. :: Converts a variable VALUE to all upper case.
  31. :: The argument for this subroutine is the variable NAME.
  32. SET %~1=!%1:a=A!
  33. SET %~1=!%1:b=B!
  34. SET %~1=!%1:c=C!
  35. SET %~1=!%1:d=D!
  36. SET %~1=!%1:e=E!
  37. SET %~1=!%1:f=F!
  38. SET %~1=!%1:g=G!
  39. SET %~1=!%1:h=H!
  40. SET %~1=!%1:i=I!
  41. SET %~1=!%1:j=J!
  42. SET %~1=!%1:k=K!
  43. SET %~1=!%1:l=L!
  44. SET %~1=!%1:m=M!
  45. SET %~1=!%1:n=N!
  46. SET %~1=!%1:o=O!
  47. SET %~1=!%1:p=P!
  48. SET %~1=!%1:q=Q!
  49. SET %~1=!%1:r=R!
  50. SET %~1=!%1:s=S!
  51. SET %~1=!%1:t=T!
  52. SET %~1=!%1:u=U!
  53. SET %~1=!%1:v=V!
  54. SET %~1=!%1:w=W!
  55. SET %~1=!%1:x=X!
  56. SET %~1=!%1:y=Y!
  57. SET %~1=!%1:z=Z!
  58. GOTO:EOF
  59.  
  60.  
  61. :Syntax
  62. 1>&2 ECHO.
  63. 1>&2 ECHO VipreVer.bat,  Version 1.00 for Windows 2000 and later
  64. 1>&2 ECHO Return the version of Sunbelt Vipre AntiVirus and its virus definitions
  65. 1>&2 ECHO.
  66. 1>&2 ECHO Usage:  VIPREVER  [ remote_computer ]
  67. 1>&2 ECHO.
  68. 1>&2 ECHO Where:  remote_computer  is an optional computer name;
  69. 1>&2 ECHO                          (default is the local computer)
  70. 1>&2 ECHO.
  71. 1>&2 ECHO Written by Rob van der Woude
  72. 1>&2 ECHO http://www.robvanderwoude.com
  73. IF "%OS%"=="Windows_NT" ENDLOCAL
  74.  

page last uploaded: 2017-08-21, 14:26