- 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

    MsgBox "現在のダンプの種類:" & CStr(Osr.DebugInfoType)
    Osr.DebugInfoType = 0
    Osr.Put_

Next

Set OsrSet = Service.ExecQuery _
                ("Select * From Win32_OSRecoveryConfiguration")
For Each Osr In OsrSet

    MsgBox "現在のダンプの種類:" & CStr(Osr.DebugInfoType)

Next


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

End Sub

Comment

実行すると現在のメモリダンプのダンプの種類の設定が表示されます。その後ダンプの種類が「なし」に変更され再度現在の設定が表示されます。
本当に設定されているか確認するにはシステムのプロパティ内の起動と回復を見てみましょう。


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