• Revista PROGRAMAR: Já está disponível a edição #53 da revista programar. Faz já o download aqui!


[Python] Win32 - Lista Install Files

1 post in this topic

Lista os programas instalados no sistema.

Faz uso da lib pyWin32.

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 " ::: ------------------------ ::: "
   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
   print " ::::                      :::\n"


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now