Why is enumerating installed MSI packages so slow?

后端 未结 5 1444
粉色の甜心
粉色の甜心 2021-01-20 18:31

This is a follow up from this question.

I\'m using this slightly modified script to enumerate all installed MSI packages:

strComputer = \".\"

Set ob         


        
5条回答
  •  悲哀的现实
    2021-01-20 18:58

    This works for me and avoids the slowness of the WMI approach:

    Dim installer
    Set installer = CreateObject("WindowsInstaller.Installer")
    Dim productCode, productName
    For Each productCode In installer.Products
        productName = installer.ProductInfo(productCode, "ProductName")
        WScript.Echo productCode & " , " & productName
    Next
    

    Find out more about the Installer object from http://msdn.microsoft.com/en-us/library/windows/desktop/aa369432(v=vs.85).aspx

提交回复
热议问题