sử dụng VBScript
Code:
Function ShowBaseboardInfo()
On Error Resume Next
DisplayOutputHeader("Baseboard - Win32_BaseBoard")
str = ""
Set objWMIService = GetWMIServices()
Set colItems = objWMIService.ExecQuery("Select * from Win32_BaseBoard")
For Each objItem in colItems
str = str & GetTableHeader()
For Each strOption in objItem.ConfigOptions
str = str & GetRow("Configuration Option", strOption)
Next
str = str & GetRow("Depth", objItem.Depth)
str = str & GetRow("Description", objItem.Description)
str = str & GetRow("Height", objItem.Height)
str = str & GetRow("Hosting Board", objItem.HostingBoard)
str = str & GetRow("Hot Swappable", objItem.HotSwappable)
str = str & GetRow("Manufacturer", objItem.Manufacturer)
str = str & GetRow("Model", objItem.Model)
str = str & GetRow("Name", objItem.Name)
str = str & GetRow("Other Identifying Information", objItem.OtherIdentifyingInfo)
str = str & GetRow("Part Number", objItem.PartNumber)
str = str & GetRow("Powered On", objItem.PoweredOn)
str = str & GetRow("Product", objItem.Product)
str = str & GetRow("Removable", objItem.Removable)
str = str & GetRow("Replaceable", objItem.Replaceable)
str = str & GetRow("Requirements Description", objItem.RequirementsDescription)
str = str & GetRow("Requires DaughterBoard", objItem.RequiresDaughterBoard)
str = str & GetRow("Serial Number", objItem.SerialNumber)
str = str & GetRow("SKU", objItem.SKU)
str = str & GetRow("Slot Layout", objItem.SlotLayout)
str = str & GetRow("Special Requirements", objItem.SpecialRequirements)
str = str & GetRow("Tag", objItem.Tag)
str = str & GetRow("Version", objItem.Version)
str = str & GetRow("Weight", objItem.Weight)
str = str & GetRow("Width", objItem.Width)
str = str & GetTableFooter()
Next
DisplayOutput(str)
End Function
Code:
Function GetRow(PropName, PropValue)
str = "<TR>"
str = str & "<TD class='PropName'>" & PropName & "</TD>"
str = str & "<TD>" & PropValue & "</TD>"
str = str & "</TR>" & vbCRLF
GetRow = str
End Function