Link to home
Start Free TrialLog in
Avatar of jamorlando
jamorlandoFlag for United States of America

asked on

VBScript to return system model

Hi,
I need a quick VBScript to take the systeminfo command from command prompt, and return the value of the "System Model: " field.

Thanks,
Jamie
ASKER CERTIFIED SOLUTION
Avatar of rogerard
rogerard
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jamorlando

ASKER

Perfect.  Trimmed down the script to this for my needs.  I'm going to be using this for my BGInfo desktop wallpaper utility.  Thanks!

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colSettings = objWMIService.ExecQuery _
    ("Select * from Win32_ComputerSystem")
For Each objComputer in colSettings
    Wscript.Echo objComputer.Model
Next