WMI Fun !! 〜 WMI に興味がある方・システム管理者は必見です! 〜 |
|
![]() |
WMI Fun !! > WMI Sample (VBS) > プロセッサ (CPU) の動作サポートビット数を取得する |
私も使っていますお勧め SIM フリースマホ ASUS Zenfone
ATM 利用時の入出金手数料が最大 7 回/月無料、 プロセッサ (CPU) の動作サポートビット数を取得する: Win32_Processor - WMI Sample (VBS)Topics
プロセッサ (CPU) の動作サポートビット数を取得するサンプルプログラムです。
Sample Code
Option Explicit
'WMIにて使用する各種オブジェクトを定義・生成する。 Dim oClassSet Dim oClass Dim oLocator Dim oService Dim sMesStr 'ローカルコンピュータに接続する。 Set oLocator = Wscript.CreateObject("WbemScripting.SWbemLocator") Set oService = oLocator.ConnectServer 'クエリー条件を WQL にて指定する。 Set oClassSet = oService.ExecQuery("Select * From Win32_Processor") 'コレクションを解析する。 For Each oClass In oClassSet If oClass.Architecture = 0 Then sMesStr = sMesStr & "名前: " & CStr(oClass.Caption) & vbCrLf & _ "32bit or 64bit: " & "32bit CPU" & vbCrLf & VbCrLf ElseIf oClass.Architecture = 9 Then sMesStr = sMesStr & "名前: " & CStr(oClass.Caption) & vbCrLf & _ "32bit or 64bit: " & "64bit CPU" & vbCrLf & VbCrLf End If Next MsgBox("CPU の動作ビット数の判断結果です。" & vbCrLf & vbCrLf & sMesStr) '使用した各種オブジェクトを後片付けする。 Set oClassSet = Nothing Set oClass = Nothing Set oService = Nothing Set oLocator = Nothing
![]() Comment
実行するとパソコンに搭載されている CPU が 32bit 対応か 64bit 対応かを判別し表示します。
を紹介しています。 ![]() Latest sample information
最近WMI Sampleへ追加したサンプルのご紹介です。
興味のあるサンプル・クラスがありましたら参考にしてみて下さい。 |
ご意見・ご要望・ご感想をこちらのアンケートからお待ちしています |
∧ ページの先頭へ… |