WSH + WMI. Примеры. Класс Win32_BaseBoard
Класс Win32_BaseBoard предоставляет сведения о материнской плате.
class Win32_BaseBoard : CIM_Card
{
string Caption;
string ConfigOptions[];
string CreationClassName;
real32 Depth;
string Description;
real32 Height;
boolean HostingBoard;
boolean HotSwappable;
datetime InstallDate;
string Manufacturer;
string Model;
string Name;
string OtherIdentifyingInfo;
string PartNumber;
boolean PoweredOn;
string Product;
boolean Removable;
boolean Replaceable;
string RequirementsDescription;
boolean RequiresDaughterBoard;
string SerialNumber;
string SKU;
string SlotLayout;
boolean SpecialRequirements;
string Status;
string Tag;
string Version;
real32 Weight;
real32 Width;
};
Пример получения сведений о материнской плате. WSH + WMI. Класс Win32_BaseBoard
//Подключились к WMI локального компьютера (".")
var root = GetObject("winmgmts:\\\\.\\root\\cimv2");
//Выполним запрос на получение сведений об операционной системе
var reswmi = root.ExecQuery("SELECT * FROM Win32_BaseBoard");
var accitem;
for(var acc = new Enumerator(reswmi); !acc.atEnd(); acc.moveNext())
accitem=acc.item();
var s = 'Caption: ' +
accitem.Caption + "\r\n"+
'Description ' +
accitem.Description + "\r\n"+
"InstallDate " +
accitem.InstallDate + "\r\n"+
'Manufacturer ' + accitem.Manufacturer + "\r\n"+
'Model ' + accitem.Model + "\r\n"+
'Name ' +
accitem.Name + "\r\n"+
'OtherIdentifyingInfo ' +
accitem.OtherIdentifyingInfo + "\r\n"+
'PartNumber ' +
accitem.PartNumber + "\r\n"+
'Product' +
accitem.Product + "\r\n"+
'SerialNumber ' + accitem.SerialNumber + "\r\n"+
'Status ' + accitem.Status + "\r\n"+
'Version ' +
accitem.Version + "\r\n"+
'Weight ' + accitem.Weight + "\r\n"+
'Width ' +
accitem.Width + "\r\n"+
"\r\n\r\n";
WScript.Echo(s);
В документации приведен следующий пример:
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_BaseBoard")
For Each objItem in colItems
For Each strOption in objItem.ConfigOptions
Wscript.Echo "Configuration Option: " & strOption
Next
Wscript.Echo "Depth: " & objItem.Depth
Wscript.Echo "Description: " & objItem.Description
Wscript.Echo "Height: " & objItem.Height
Wscript.Echo "Hosting Board: " & objItem.HostingBoard
Wscript.Echo "Hot Swappable: " & objItem.HotSwappable
Wscript.Echo "Manufacturer: " & objItem.Manufacturer
Wscript.Echo "Model: " & objItem.Model
Wscript.Echo "Name: " & objItem.Name
Wscript.Echo "Other Identifying Information: " & _
objItem.OtherIdentifyingInfo
Wscript.Echo "Part Number: " & objItem.PartNumber
Wscript.Echo "Powered-On: " & objItem.PoweredOn
Wscript.Echo "Product: " & objItem.Product
Wscript.Echo "Removable: " & objItem.Removable
Wscript.Echo "Replaceable: " & objItem.Replaceable
Wscript.Echo "Requirements Description: " & objItem.RequirementsDescription
Wscript.Echo "Requires Daughterboard: " & objItem.RequiresDaughterBoard
Wscript.Echo "Serial Number: " & objItem.SerialNumber
Wscript.Echo "SKU: " & objItem.SKU
Wscript.Echo "Slot Layout: " & objItem.SlotLayout
Wscript.Echo "Special Requirements: " & objItem.SpecialRequirements
Wscript.Echo "Tag: " & objItem.Tag
Wscript.Echo "Version: " & objItem.Version
Wscript.Echo "Weight: " & objItem.Weight
Wscript.Echo "Width: " & objItem.Width
Next
Более подробно о классе Win32_BaseBoard смотрите на MSDN.
Для вопросов, обсуждений, замечаний, предложений и т. п. можете использовать раздел форума этого сайта (требуетс¤ регистраци¤).