@echo off :: Initialize variant set /a system_version_number = 0
:: check for system version first ver.exe > ver 2>NUL for /f "tokens=2 delims=[" %%j in (ver) do ( echo %%j > version 2>NUL ) del /q /f ver >NUL 2>NUL
::Remove Space for /f "tokens=2 delims= " %%j in (version) do ( echo %%j > ver 2>NUL ) del /q /f version >NUL 2>NUL
::Get the fisrt version number for /f "tokens=1 delims=." %%j in (ver) do ( set /a system_version_number = %%j 2>NUL ) del /q /f ver >NUL 2>NUL
if %system_version_number% EQU 0 goto END if %system_version_number% EQU 5 goto XP if %system_version_number% GEQ 6 goto VISTA
:XP echo The current OS is XP. echo. echo --Antivirus product infomation: %systemroot%\system32\wbem\wmic.exe /node:localhost /namespace:\\root\securitycenter path AntivirusProduct get companyName,displayName,productUptodate,versionNumber,instanceGuid /format:textvaluelist 2>NUL echo. echo. echo --Firewall product infomation: %systemroot%\system32\wbem\wmic.exe /node:localhost /namespace:\\root\securitycenter path FirewallProduct get companyName,displayName,enabled,versionNumber,instanceGuid /format:textvaluelist 2>NUL echo --Note: In XP, the versionNumber maybe not synchronized with Antivirus or Firewall products-- goto END
:VISTA echo The current OS is Vista, Win 7 or higher. echo. echo --Antivirus product infomation: %systemroot%\system32\wbem\wmic.exe /node:localhost /namespace:\\root\securitycenter2 path AntivirusProduct get displayName,productState,instanceGuid,pathToSignedProductExe /format:textvaluelist 2>NUL echo. echo. echo --Firewall product infomation: %systemroot%\system32\wbem\wmic.exe /node:localhost /namespace:\\root\securitycenter2 path FirewallProduct get displayName,productState,instanceGuid,pathToSignedProductExe /format:textvaluelist 2>NUL echo. echo. echo --AntiSpayware product infomation: %systemroot%\system32\wbem\wmic.exe /node:localhost /namespace:\\root\securitycenter2 path AntiSpywareProduct get displayName,productState,instanceGuid,pathToSignedProductExe /format:textvaluelist 2>NUL
:END pause
|