WMI Fun !! 〜 WMI に興味がある方・システム管理者必見! 〜 |
|
![]() |
WMI Fun !! > WMI Sample (VB) > MSI でインストールされたアプリケーションの取得する |
Panasonic Let'snote を長年愛用しています、その理由は My Let'snote で…
中古車買うならやっぱり IT 関連情報を気軽に知りたい方へ、 MSI でインストールされたアプリケーションの取得する: Win32_Product - WMI Sample (VB)Topics
MSI でインストールされたアプリケーションの一覧を取得するサンプルプログラムです。
Sample Code
Private Sub Command1_Click()
Dim PrdSet As SWbemObjectSet Dim Prd As SWbemObject Dim Locator As SWbemLocator Dim Service As SWbemServices Dim MesStr As String Set Locator = New WbemScripting.SWbemLocator Set Service = Locator.ConnectServer Set PrdSet = Service.ExecQuery _ ("Select * From Win32_Product") For Each Prd In PrdSet MesStr = MesStr & "ソフト名: " & Prd.Name & vbTab & _ "インストール日時: " & Prd.InstallDate & vbCrLf Next MsgBox "MSI でインストールされたアプリは、" & _ vbCrLf & vbCrLf & MesStr & vbCrLf & "ですよ。" Set PrdSet = Nothing Set Prd = Nothing Set Locator = Nothing Set Service = Nothing End Sub
![]() Comment
実行すると MSI を使用してインストールされたアプリケーションの一覧が取得できます。今回はソフト名とインストール日時を取得しています。 ![]() Recommended book
個人的にお勧めする本の紹介です。 ![]() |
ご意見・ご要望・ご感想をこちらのアンケートからお待ちしています |
∧ ページの先頭へ… |