9 out of 21 rated this helpful - Rate this topic

Win32_Product class

The Win32_Product WMI class represents products as they are installed by Windows Installer. A product generally correlates to one installation package.

Note  For more information about support or requirements for installation of a specific operating system, see Operating System Availability of WMI Components.

The following syntax is simplified from Managed Object Format (MOF) code and includes all inherited properties. Properties and methods are in alphabetic order, not MOF order.

Syntax

class Win32_Product : CIM_Product
{
  uint16   AssignmentType;
  string   Caption;
  string   Description;
  string   IdentifyingNumber;
  string   InstallDate;
  datetime InstallDate2;
  string   InstallLocation;
  sint16   InstallState;
  string   HelpLink;
  string   HelpTelephone;
  string   InstallSource;
  string   Language;
  string   LocalPackage;
  string   Name;
  string   PackageCache;
  string   PackageCode;
  string   PackageName;
  string   ProductID;
  string   RegOwner;
  string   RegCompany;
  string   SKUNumber;
  string   Transforms;
  string   URLInfoAbout;
  string   URLUpdateInfo;
  string   Vendor;
  uint32   WordCount;
  string   Version;
};

Members

The Win32_Product class has these types of members:

Methods

The Win32_Product class has these methods.

MethodDescription
Admin

Performs an administrative install of an associated Win32_Product instance using the installation package provided through PackageLocation, and any command line options that are supplied.

Advertise

Advertises an associated Win32_Product instance using the installation package provided through PackageLocation and any command line options that are supplied.

Configure

Configures the associated instance of Win32_Product to the specified install state and level.

Install

Installs an associated Win32_Product instance using the installation package provided through PackageLocation and any command line options that are supplied.

Reinstall

Reinstalls the associated instance of Win32_Product using the specified reinstallation mode.

Uninstall

Uninstalls the associated instance of Win32_Product.

Upgrade

Upgrades the associated Win32_Product instance using the upgrade package provided through PackageLocation and any command line options that are supplied.

 

Properties

The Win32_Product class has these properties.

AssignmentType
Data type: uint16
Access type: Read-only

Assignment type of the product.

Windows Server 2003, Windows XP, and Windows 2000:  This property is not available.

Possible values are

ValueMeaning
0

The product is assigned by user.

1

The product is assigned by computer.

 

Caption
Data type: string
Access type: Read-only

Short textual description for the product—a one-line string.

Description
Data type: string
Access type: Read-only

Description of the product.

HelpLink
Data type: string
Access type: Read-only

The support link for the product.

Windows Server 2003, Windows XP, and Windows 2000:  This property is not available.
HelpTelephone
Data type: string
Access type: Read-only

The support telephone for the product.

Windows Server 2003, Windows XP, and Windows 2000:  This property is not available.
IdentifyingNumber
Data type: string
Access type: Read-only

Product identification such as a serial number on software, or a die number on a hardware chip.

InstallDate
Data type: string
Access type: Read-only

Starting with Windows XP this property is no longer supported for Win32_Product. Instead, use the InstallDate2 property, which is in the WMI CIM_DATETIME format.

Windows 2000:  Date that this product is installed on the system. This property does not need a value to indicate that the object is installed.

InstallDate2
Data type: datetime
Access type: Read-only

Date that this product was installed on the system. This property does not require a value to indicate that the object is installed. For more information about WMI dates and times, see Date and Time Format.

Windows 2000:  This property is not available.
InstallLocation
Data type: string
Access type: Read-only

Location of the installed product.

InstallSource
Data type: string
Access type: Read-only

The installation source directory of the product.

Windows Server 2003, Windows XP, and Windows 2000:  This property is not available.
InstallState
Data type: sint16
Access type: Read-only

Installed state of the product.

ValueMeaning
-6

Bad Configuration

-2

Invalid Argument

-1

Unknown Package

1

Advertised

2

Absent

5

Installed

 

Language
Data type: string
Access type: Read-only

The language of the product.

Windows Server 2003, Windows XP, and Windows 2000:  This property is not available.
LocalPackage
Data type: string
Access type: Read-only

The location of the locally cached package for this product.

Windows Server 2003, Windows XP, and Windows 2000:  This property is not available.
Name
Data type: string
Access type: Read-only
Qualifiers: Key

Commonly used product name.

PackageCache
Data type: string
Access type: Read-only

Location of the locally cached package for this product.

PackageCode
Data type: string
Access type: Read-only

The identifier for the package from which this product was installed.

Windows Server 2003, Windows XP, and Windows 2000:  This property is not available.
PackageName
Data type: string
Access type: Read-only

The original package name for the product.

Windows Server 2003, Windows XP, and Windows 2000:  This property is not available.
ProductID
Data type: string
Access type: Read-only

The product ID.

Windows Server 2003, Windows XP, and Windows 2000:  This property is not available.
RegCompany
Data type: string
Access type: Read-only

The company registered to use the product.

Windows Server 2003, Windows XP, and Windows 2000:  This property is not available.
RegOwner
Data type: string
Access type: Read-only

The owner registered to use the product.

Windows Server 2003, Windows XP, and Windows 2000:  This property is not available.
SKUNumber
Data type: string
Access type: Read-only

Product SKU (stock-keeping unit) information.

Transforms
Data type: string
Access type: Read-only

The transforms of the product.

Windows Server 2003, Windows XP, and Windows 2000:  This property is not available.
URLInfoAbout
Data type: string
Access type: Read-only

The URL information for the product.

Windows Server 2003, Windows XP, and Windows 2000:  This property is not available.
URLUpdateInfo
Data type: string
Access type: Read-only

The URL update information the product.

Windows Server 2003, Windows XP, and Windows 2000:  This property is not available.
Vendor
Data type: string
Access type: Read-only

Name of the product supplier. Corresponds to the Vendor property in the product object in the Desktop Management Task Force (DMTF) Solution Exchange Standard.

Version
Data type: string
Access type: Read-only

Product version information. Corresponds to the Version property in the product object in the DMTF Solution Exchange Standard.

WordCount
Data type: uint32
Access type: Read-only

Number of words in the summary information for the product.

Windows Server 2003, Windows XP, and Windows 2000:  This property is not available.

Remarks

The Win32_Product class is derived from CIM_Product.

Examples

For script code examples, see WMI Tasks for Scripts and Applications and the TechNet ScriptCenter Script Repository.

For C++ code examples, see WMI C++ Application Examples.

The following code example shows how to generate an inventory list of installed software on a local computer. The script generates a text file with a list of the software and versions installed on a local computer.

strComputer = "."

Set objWMIService = GetObject("winmgmts:" & _
    "{impersonationLevel=impersonate}!\\" & _
    strComputer & _
    "\root\cimv2")

Set colSoftware = objWMIService.ExecQuery _
    ("SELECT * FROM Win32_Product")   

If colSoftware.Count > 0 Then

    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objTextFile = objFSO.CreateTextFile( _
        "c:\SoftwareList.txt", True)

    For Each objSoftware in colSoftware
        objTextFile.WriteLine objSoftware.Caption & vbtab & _
        objSoftware.Version
    Next

    objTextFile.Close

Else
    WScript.Echo "Cannot retrieve software from this computer."

End If

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Namespace

\root\CIMV2

MOF

Msi.mof

DLL

Msiprov.dll

See also

Installed Applications Classes

 

 

Send comments about this topic to Microsoft

Build date: 11/19/2012

Community Additions

ADD
© 2013 Microsoft. All rights reserved.