Ok, to make things simpler, I have made this:

Object can be found here*
Property will be under the Object in the above mentioned link
N is the Nth object found. (It's optional)

$WMI(Property,N).Object
Code:
alias WMI {

  if (!$isid || !$1 || !$prop || $2. !isnum || $0 != 2) { return }

  var %r

  if ($com(WMILoc)) { .comclose WMILoc }
  if ($com(WMISrv)) { .comclose WMISrv }
  if ($com(WMIGet)) { .comclose WMIGet }

  .comopen WMILoc WbemScripting.SWbemLocator
  if ($comerr) { goto error }
  elseif (!$com(WMILoc,ConnectServer,3,dispatch* WMISrv)) { goto error }
  elseif (!$com(WMISrv,ExecQuery,3,bstr*,select $1 from $Prop,dispatch* WMIGet)) { goto error }
  %r = $comval(WMIGet,$iif($2,$2,1),$1)

  :error
  if ($com(WMILoc)) { .comclose WMILoc }
  if ($com(WMISrv)) { .comclose WMISrv }
  if ($com(WMIGet)) { .comclose WMIGet }
  return %r
}


* To see a list of properties for an object, find it on the left-hand side of the webpage under "win 32", click it then scroll down until you see the header "Properties" in blue in the right panel of the webpage. This is the data that can be returned with my alias for the specified class.

;Edited for:
; Changed the name of the alias from $statGet to $WMI
; Fixed small bug: "prop" should have been(and is now) $prop
; Added check to make sure the alias was being used as an identifier
;Added note about website

Last edited by FroggieDaFrog; 22/03/11 10:32 PM.