Code Script .co.uk

Home | Scripts | Tutorials | Disclaimer | Sitemap | Contact

   Get Machine Hardware Model
 

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.
 
   Actions
  Go Back
  Bookmark
  Print Page


   Menu
 
- Links
- Reference
- Script Editors
- Tutorials