WMI Fun !! 〜 WMI に興味がある方・システム管理者必見! 〜 |
|
![]() |
WMI Fun !! > WMI Sample (VB) > MSI 形式のアプリケーションのインストールを行う |
MSI 形式のアプリケーションのインストールを行う: Win32_Product - WMI Sample (VB)Topics
MSI アプリケーションのインストールを行います。
Sample Code
Private Sub Command1_Click()
Dim Prd As SWbemObject Dim Locator As SWbemLocator Dim Service As SWbemServices Dim Ret As Long Dim PID As Long Dim MesStr As String Set Locator = New WbemScripting.SWbemLocator Set Service = Locator.ConnectServer() Set Prd = Service.Get("Win32_Product") Ret = Prd.Install("c:\setup.msi", , True) If Ret = 0 Then MsgBox "インストールを終了しました。" Else MsgBox "インストールに失敗しました。" End If Set Prd = Nothing Set Service = Nothing Set Locator = Nothing End Sub
![]() Comment
実行するためにはテスト用の MSI ファイルが必要になります。こちらにテスト用の MSI ファイルを用意しておきましたので使ってみてください。 ![]() Recommended book
個人的にお勧めする本の紹介です。 ![]() |
ご意見・ご要望・ご感想をこちらのアンケートからお待ちしています |
∧ ページの先頭へ… |