Click here to Skip to main content
15,943,089 members
Home / Discussions / C#
   

C#

 
GeneralEmail clients Pin
wfe9-May-04 12:13
wfe9-May-04 12:13 
GeneralRe: Email clients Pin
Dave Kreskowiak10-May-04 0:11
mveDave Kreskowiak10-May-04 0:11 
GeneralRe: Email clients Pin
wfe10-May-04 1:17
wfe10-May-04 1:17 
GeneralRe: Email clients Pin
Heath Stewart10-May-04 3:49
protectorHeath Stewart10-May-04 3:49 
GeneralRe: Email clients Pin
wfe10-May-04 7:59
wfe10-May-04 7:59 
GeneralRe: Email clients Pin
Heath Stewart10-May-04 8:58
protectorHeath Stewart10-May-04 8:58 
GeneralRe: Email clients Pin
wfe10-May-04 9:23
wfe10-May-04 9:23 
GeneralRe: Email clients Pin
Heath Stewart10-May-04 9:43
protectorHeath Stewart10-May-04 9:43 
Did you actually read the article? Understanding WMI is simple: it's script-based access to information on remote machines. You don't have to understand CIM, which is like WMI standard classes.

A simple way to query a remote client for products is like so:
public void EnumProducts(string machine)
{
  string scope = "root\\cimv2";
  if (machine != null && machine.Length > 0) scope = string.Format(
    "\\\\{0}\\{1}", machine, scope);
  ManagementObjectSearcher searcher = new ManagementObjectSearcher(
    scope,
    "SELECT * FROM Win32_Product");
  ManagementObjectCollection products = searcher.Get();
  foreach (ManagementObject product in products)
    Console.WriteLine(product["Name"]);
}
Note that this will only enumerator products installed via Windows Installer.

If you read the article, you'll see a link to a VS.NET add-in that creates a typed class for the Win32_Product class (or whatever class you use). This makes it much easier to use and enumerate.

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: Email clients Pin
wfe11-May-04 3:00
wfe11-May-04 3:00 
GeneralRe: Email clients Pin
Heath Stewart11-May-04 3:12
protectorHeath Stewart11-May-04 3:12 
GeneralMemory Usage of a console application Pin
eranas9-May-04 10:25
eranas9-May-04 10:25 
GeneralRe: Memory Usage of a console application Pin
Jeff Varszegi9-May-04 12:11
professionalJeff Varszegi9-May-04 12:11 
GeneralRe: Memory Usage of a console application Pin
Heath Stewart10-May-04 3:39
protectorHeath Stewart10-May-04 3:39 
GeneralMouse Drag Event Pin
Member 6910899-May-04 7:15
Member 6910899-May-04 7:15 
GeneralRe: Mouse Drag Event Pin
Mazdak9-May-04 7:52
Mazdak9-May-04 7:52 
GeneralFree disk space Pin
kratchkov9-May-04 5:15
kratchkov9-May-04 5:15 
GeneralRe: Free disk space Pin
Mazdak9-May-04 5:21
Mazdak9-May-04 5:21 
GeneralRe: Free disk space Pin
kratchkov9-May-04 5:30
kratchkov9-May-04 5:30 
GeneralRe: Free disk space Pin
Mike Dimmick9-May-04 7:12
Mike Dimmick9-May-04 7:12 
GeneralRe: Free disk space Pin
kratchkov9-May-04 7:36
kratchkov9-May-04 7:36 
Generalrepaint a TreeView Pin
cristina_tudor9-May-04 5:05
cristina_tudor9-May-04 5:05 
GeneralRe: repaint a TreeView Pin
Mazdak9-May-04 5:15
Mazdak9-May-04 5:15 
GeneralBug in java.util.zip.Zipfile Pin
Nish Nishant8-May-04 23:15
sitebuilderNish Nishant8-May-04 23:15 
GeneralRe: Bug in java.util.zip.Zipfile Pin
Kannan Kalyanaraman9-May-04 1:59
Kannan Kalyanaraman9-May-04 1:59 
GeneralRe: Bug in java.util.zip.Zipfile Pin
Nish Nishant9-May-04 2:45
sitebuilderNish Nishant9-May-04 2:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.