Vbscript / Operating System / Get Machine Hardware Model
Get the hardware model of a computer using the Win32_ComputerSystem WMI class. e.g. Precision M25
Const wbemFlagReturnImmediately = &h10 Const wbemFlagForwardOnly = &h20
strComputer = "."
Set objWMIService = GetObject("winmgmts:\" & strComputer & "\root\CIMV2") Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem", "WQL", _ wbemFlagReturnImmediately + wbemFlagForwardOnly)
For Each objItem In colItems
WScript.Echo "Model: " & objItem.Model Next
Please note that a disclaimer applies to any code on this page.
|