Click here to Skip to main content
15,920,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
please help me!!!
how to get date and time application installed like Installon colume in Progreams and Features 's windows 7?
Posted
Updated 31-May-13 1:03am
v2

Look here: http://include.wutils.com/wmi/ROOT%5Ccimv2/CIM_Product/Win32_Product/cs-samples.html[^]

[update: generated code]
C#
// WMI query to list all properties and values of the root\CIMV2:Win32_Product class.
// This C# code was generated using the WMI Code Generator, Version 7.03
// http://www.robvanderwoude.com/wmigen.php

using System;
using System.Linq;
using System.Management;

namespace WMIGen
{
	public class Win32_Product_Query
	{
		public static int Main(string[] args)
		{
			try
			{
				string computer = string.Empty;
				if (args.Count() == 1)
				{
					computer = @"\\" + args[0] + @"\";
				}

				ManagementObjectSearcher searcher = new ManagementObjectSearcher(computer + @"root\CIMV2", "SELECT * FROM Win32_Product");
				ManagementObjectCollection colItems = searcher.Get( );

				Console.WriteLine( "{0} instance{1}", colItems.Count, ( colItems.Count == 1 ? String.Empty : "s" ) );
				Console.WriteLine( );

				foreach ( ManagementObject queryObj in colItems )
				{
					Console.WriteLine("AssignmentType    : {0}", queryObj["AssignmentType"]);
					Console.WriteLine("Caption           : {0}", queryObj["Caption"]);
					Console.WriteLine("Description       : {0}", queryObj["Description"]);
					Console.WriteLine("HelpLink          : {0}", queryObj["HelpLink"]);
					Console.WriteLine("HelpTelephone     : {0}", queryObj["HelpTelephone"]);
					Console.WriteLine("IdentifyingNumber : {0}", queryObj["IdentifyingNumber"]);
					Console.WriteLine("InstallDate       : {0}", queryObj["InstallDate"]);
					Console.WriteLine("InstallDate2      : {0}", queryObj["InstallDate2"]);
					Console.WriteLine("InstallLocation   : {0}", queryObj["InstallLocation"]);
					Console.WriteLine("InstallSource     : {0}", queryObj["InstallSource"]);
					Console.WriteLine("InstallState      : {0}", queryObj["InstallState"]);
					Console.WriteLine("Language          : {0}", queryObj["Language"]);
					Console.WriteLine("LocalPackage      : {0}", queryObj["LocalPackage"]);
					Console.WriteLine("Name              : {0}", queryObj["Name"]);
					Console.WriteLine("PackageCache      : {0}", queryObj["PackageCache"]);
					Console.WriteLine("PackageCode       : {0}", queryObj["PackageCode"]);
					Console.WriteLine("PackageName       : {0}", queryObj["PackageName"]);
					Console.WriteLine("ProductID         : {0}", queryObj["ProductID"]);
					Console.WriteLine("RegCompany        : {0}", queryObj["RegCompany"]);
					Console.WriteLine("RegOwner          : {0}", queryObj["RegOwner"]);
					Console.WriteLine("SKUNumber         : {0}", queryObj["SKUNumber"]);
					Console.WriteLine("Transforms        : {0}", queryObj["Transforms"]);
					Console.WriteLine("URLInfoAbout      : {0}", queryObj["URLInfoAbout"]);
					Console.WriteLine("URLUpdateInfo     : {0}", queryObj["URLUpdateInfo"]);
					Console.WriteLine("Vendor            : {0}", queryObj["Vendor"]);
					Console.WriteLine("Version           : {0}", queryObj["Version"]);
					Console.WriteLine("WordCount         : {0}", queryObj["WordCount"]);
					Console.WriteLine();
				}
				return 0;
			}
			catch (Exception e)
			{
				Console.Error.WriteLine("An error occurred while querying WMI: {0}", e.Message);
				return 1;
			}
		}
	}
}
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900