|
WMI Fun !! 〜 WMIに興味がある方・システム管理者必見!! 〜 WMI StepWMI SampleWMI ReferenceWMI LibraryMy Let'snotePersonalLinkAbout WMI Fun !! |
|
|
|
WMI Fun !! > WMI Sample (VBS) > プリンタドライバに関する情報を取得する |
|
|
Panasonic Let'snoteを長年愛用しています、その理由はMy Let'snoteで…
インクを買うよりもしかしたら安い?インクジェット複合機HP Photosmart 5510 白いご飯や日本酒にもとても合うにしんのきりこみがマイブームです プリンタドライバに関する情報を取得する: Win32_PrinterDriver - WMI Sample (VBS)Topics
プリンタドライバに関する情報を取得するサンプルプログラムです。
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_PrinterDriver") 'コレクションを解析する。 For Each oClass In oClassSet sMesStr = sMesStr & "プリンタ名: " & oClass.Name & vbCrLf & _ "コンフィグファイル: " & oClass.ConfigFile & vbCrLf & _ "データファイル: " & oClass.DataFile & vbCrLf & _ "ドライバパス: " & oClass.DriverPath & vbCrLf & _ "ヘルプファイル: " & oClass.HelpFile & vbCrLf & _ "サポートプラットフォーム: " & oClass.SupportedPlatform & vbCrLf & vbCrLf Next MsgBox "プリンタドライバに関する情報です。" & vbCrLf & vbCrLf & sMesStr '使用した各種オブジェクトを後片付けする。 Set oClassSet = Nothing Set oClass = Nothing Set oService = Nothing Set oLocator = Nothing
Comment
実行するとコンピュータに存在するプリンタドライバを列挙して一覧を表示します。
を紹介しています。
Recommended book
個人的にお勧めする本の紹介です。
Latest sample information
最近WMI Sampleへ追加したサンプルのご紹介です。
|
|
ご意見・ご要望・ご感想をこちらのアンケートからお待ちしています |
| ∧ ページの先頭へ… |