WMI Fun !! 〜 WMI に興味がある方・システム管理者は必見です! 〜 |
|
![]() |
WMI Fun !! > WMI Sample (VBS) > 物理メモリ容量を取得する |
私も使っていますお勧め SIM フリースマホ ASUS Zenfone
ATM 利用時の入出金手数料が最大 7 回/月無料、 物理メモリ容量を取得する: Win32_ComputerSystem - WMI Sample (VBS)Topics
コンピュータに搭載されている物理メモリ容量を取得するサンプルプログラムです。
Sample Code
Option Explicit
'WMIにて使用する各種オブジェクトを定義・生成する。 Dim oClassSet Dim oClass Dim oLocator Dim oService Dim lRet 'ローカルコンピュータに接続する。 Set oLocator = WScript.CreateObject("WbemScripting.SWbemLocator") Set oService = oLocator.ConnectServer 'クエリー条件を WQL にて指定する。 Set oClassSet = oService.ExecQuery("Select * From Win32_ComputerSystem") 'コレクションを解析する。 For Each oClass In oClassSet lRet = oClass.TotalPhysicalMemory Next MsgBox "物理メモリ容量は、" & CStr(lRet) & "Byteです。" '使用した各種オブジェクトを後片付けする。 Set oClassSet = Nothing Set oClass = Nothing Set oService = Nothing Set oLocator = Nothing
![]() Comment
実行すると現在コンピュータに搭載されている物理メモリの総容量が表示されます。
を紹介しています。 ![]() Latest sample information
最近WMI Sampleへ追加したサンプルのご紹介です。
興味のあるサンプル・クラスがありましたら参考にしてみて下さい。 |
ご意見・ご要望・ご感想をこちらのアンケートからお待ちしています |
∧ ページの先頭へ… |