Okay, I have purchased a windows machine and the script worked fine!I reviewed the code and it does nothave a function to determine the pc type. I need WMI to find the class and a function to determine the chassis type. I have rewrote the code but it does not work. Could you please look over it and tellme what I did wrong!Option Explicit'On Error Resume NextDim strComputerDim strChassisDim colChassisDim wmiRootDim wmiQueryDim objWMIServiceDim colItemsDim objItemstrComputer = '.' WmiRoot = 'winmgmts:' & strComputer & 'rootcimv2'wmiQuery = 'Select.
For instance, while I do find myself using PowerShell occasionally for. Verifying the serial number of a remote computer: 1. Wmic /node:'site1-pc1' systemenclosure get serialnumber. AssetTag: wmic SystemEnclosure get SMBIOSAssetTag. BIOS version: wmic BIOS get SMBIOSBIOSVersion. Another easy method to browse the WMI database is to use the HTA built by the Scripting Guys called Scriptomatic v2. 12 thoughts on “ How to Query WMI from Command Line with WMIC tool ”.
from Win32SystemEnclosure'Set objWMIService = GetObject(wmiRoot)Set colItems = objWMIService.ExecQuery (wmiQuery)For Each objItem in colChassisWScript.Echo funPCChassis(objItem.ChassisTypes)NextFunction funPCChassis(intIN)Select Case intINCase 0funPCChassis = 'Desktop'Case ElsefunPCChassis = 'Laptop'End SelectEnd Function.