Python 列出 windows 安装的软件
Python 列出 windows 安装的软件
import win32com.client strComputer = "." objWMIService = win32com.client.Dispatch("WbemScripting.SWbemLocator") objSWbemServices = objWMIService.ConnectServer(strComputer,"root\cimv2") colItems = objSWbemServices.ExecQuery("Select * from Win32_Product") for objItem in colItems: print "Caption: ", objItem.Caption print "Description: ", objItem.Description print "Identifying Number: ", objItem.IdentifyingNumber print "Install Date: ", objItem.InstallDate print "Install Date 2: ", objItem.InstallDate2 print "Install Location: ", objItem.InstallLocation print "Install State: ", objItem.InstallState print "Name: ", objItem.Name print "Package Cache: ", objItem.PackageCache print "SKU Number: ", objItem.SKUNumber print "Vendor: ", objItem.Vendor print "Version: ", objItem.Version
未经博主允许,禁止直接转载本博客任何内容(可以在文章中添加链接,禁止原文照搬),如需直接原文转载对应文章,请在该文章中留言联系博主,谢谢!!