Chinaunix首页 | 论坛 | 博客
  • 博客访问: 155447
  • 博文数量: 31
  • 博客积分: 2085
  • 博客等级: 大尉
  • 技术积分: 350
  • 用 户 组: 普通用户
  • 注册时间: 2005-11-07 13:16
文章分类

全部博文(31)

文章存档

2014年(1)

2011年(4)

2010年(6)

2009年(2)

2008年(2)

2007年(5)

2006年(8)

2005年(3)

我的朋友

分类: WINDOWS

2009-11-20 17:41:09

 

关键词:bat WMI Windows 杀毒软件 防火墙

@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


阅读(1598) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~