- WMI Fun !! -|WMI StepWMI SampleSearchWMI Fun !! GroupsAbout WMI Fun !!
Top Page >> WMI Step >> メモリダンプの情報を取得する
メモリダンプの情報を取得する
Topics

メモリダンプの情報を取得するサンプルです。Win32_OSRecoveryConfigurationクラスを使用しています。


Sample Code

Private Sub Command1_Click()

Dim OsrSet As SWbemObjectSet
Dim Osr As SWbemObject
Dim Locator As SWbemLocator
Dim Service As SWbemServices
Dim MesStr As String

Set Locator = New WbemScripting.SWbemLocator
Set Service = Locator.ConnectServer
Set OsrSet = Service.ExecQuery _
("Select * From Win32_OSRecoveryConfiguration")

For Each Osr In OsrSet

    MesStr = MesStr + _
    "自動的に再起動する:" & Osr.AutoReboot & vbCrLf & _
    "システムログにイベントを書き込む:" & Osr.WriteToSystemLog & vbCrLf & _
    "ダンプの種類:" & CStr(Osr.DebugInfoType) & vbCrLf

Next

MsgBox "メモリダンプの情報です。" & vbCrLf & _
                vbCrLf & MesStr & vbCrLf & "ですよ。"

Set OsrSet = Nothing
Set Osr = Nothing
Set Locator = Nothing
Set Service = Nothing

End Sub

Comment

実行すると現在のメモリダンプの設定内容が表示されます。
実際どこの情報かと言うとシステムのプロパティ内の起動と回復です。
ダンプの種類では数字しか出ませんが以下のような意味があります。


0:なし
1:完全メモリダンプ
2:カーネルメモリダンプ
3:最小メモリダンプ


WMI を本で勉強したい方へ。 Windows PowerShellインアクション を読んでみては?
なかなか WMI のことが乗っている書籍は少ないですが…管理系業務に係る方には楽しめるかも?
パソコンで目が疲れたら、ブルーベリーアイ
『ブルーベリーアイ』1粒中ビルベリーエキス160mg【楽天シニア市場】
 ^ Copyright(C) 1997-2008 とお All rights reserved. <<