| - WMI Fun !! -|WMI Step|WMI Sample|WMI Reference|WMI LibraryLinks|About WMI Fun !! |
|
|
|
|
Home > WMI Sample > アンチウイルスソフトウェアがインストールされていることを確認する
|
|
アンチウイルスソフトウェアがインストールされていることを確認する: AntiVirusProduct
■Topics
アンチウイルスソフトウェアがインストールされていることを確認するサンプルです。名前空間は「Root\SecurityCenter」、クラスが「AntiVirusProduct」になります。
Private Sub Command1_Click()
Dim AvpSet As SWbemObjectSet Dim Avp As SWbemObject Dim Locator As SWbemLocator Dim Service As SWbemServices Dim MesStr As String Set Locator = New WbemScripting.SWbemLocator Set Service = Locator.ConnectServer(, "Root\SecurityCenter") Set AvpSet = Service.ExecQuery("Select * From AntiVirusProduct") For Each Avp In AvpSet MesStr = MesStr & vbCrLf & "製造元:" & Avp.CompanyName & vbCrLf & _ "アンチウイルスソフト名:" & Avp.DisplayName & vbCrLf & _ "バージョン:" & Avp.versionNumber & vbCrLf Next MsgBox "インストールされているアンチウイルスソフトの情報です。" & _ vbCrLf & MesStr & vbCrLf & "ですよ。" Set AvpSet = Nothing Set Avp = Nothing Set Locator = Nothing Set Service = Nothing End Sub
実行すると現在インストールされているアンチウイルスソフトウェアを表示します。今回使用した「AntiVirusProduct」クラスはWindows XP SP2より追加された新しいクラスで、「Root\SecurityCenter」という新しい名前空間に定義されています。
|
|
ご意見・ご感想をこちらのアンケートからお待ちしています
解らないIT/パソコン用語は - WMI Fun !! - http://www.wmifun.net/ Microsoft社のテクノロジーであるWMI(Windows Management Instrumentation)の使い方を Visual Basicを使ってのんびり公開しています VBや.Net Framework(VB,C#)以外でもWSH(VBS)やPowerShellなどのスクリプトでも使えますよ! 資産管理や監視業務の効率化、システム系ツール開発にお勧めです This web site created by Toh. Copyright(C) 1997-2010 WMI Fun !!. All rights reserved. このサイトへのリンクはフリーです |
| ∧ ページの先頭へ… |