Here's just an example using what Invision has for displaying some of the system information. It was given to me in almost the same form on the forum here a long time ago and I've made just some minor changes to make it more flexible.

Code:
iSystem {
  ; $1 = Win32_Class
  ; $2 = Property Requested
  ; $3 = Device Number
  .comopen xpver1 WbemScripting.SWbemLocator
  .comclose xpver1 $com(xpver1,ConnectServer,1,dispatch* xpver2)
  if $com(xpver2) {
    .comclose xpver2 $com(xpver2,ExecQuery,1,bstr*,select $2 from Win32_ $+ $1,dispatch* xpver3)
    if $com(xpver3) {
      var %a = $comval(xpver3,$3,$2)
      .comclose xpver3
      return %a
    }
  }
}


An example use would be:

//echo -a $iSystem(OperatingSystem,Caption,1)

A few notes on this. This alias inserts Win32_ in front of $1 so it doesn't have to be entered every time, so this is really looking at Win32_OperatingSystem. Caption ($2) is what we want and $3 is the device number we want to look at. For OS, the device number not important, but if you were looking at RAM or hard drives or something that can have multiple items, this gives you details on whichever one you want to look at. As a note, using 0 will give you the count of the number of items for what you're looking at.

Now, this is a very general alias and even though it's flexible, it can't do everything you might want it to do. For example, if you want to add up all RAM, you'd either need to loop the entire alias for each chip or you'd need a loop within the alias. So it's a starting place, but you'd want to adjust it as needed. If find that the msdn site gives a good view of all the COM objects you'll ever need and all the properties for them with descriptions and what OS requirements are needed to get that information.

One other thing to keep in mind. Manufacturers don't always provide all of the information you want. For examples, a graphics card's name, caption, or description might only say "ATI 4000 series" or something similar rather than the actual card name. A motherboard may only say "motherboard". COM can only get what the manufacturer provides.


Invision Support
#Invision on irc.irchighway.net