Video Screencast Help
Symantec to Separate Into Two Focused, Industry-Leading Technology Companies. Learn more.

PC Type in Ghost Console

Created: 24 Oct 2013 | 1 comment

Hello all,

I was wondering if it was possible to determine the make and model of PC within an image (?)

OS: Windows 7 Pro, 64-bit

Ghost Cast Server 11.5.1.2266

Please ask if there is more information that is required to answer this question.

Thanks in advance,

-Jeff

Operating Systems:

Comments 1 CommentJump to latest comment

EdT's picture

You can use WMI (which is supported under WinPE as long as the WMI support module is installed) to get the make and model. Here is some code that I used to detect which one of several Lenovo models the build was running on:

 
 
ver="CHASSIS - 2 September 2009"
subtype=""
mdl="-(SUPPORTED)"
desc="UNSUPPORTED"
Const ForReading = 1, ForWriting = 2
Dim fso, f, yesno
Set fso = CreateObject("Scripting.FileSystemObject")
strComputer = "."
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
 
' Identify Machine Type and then partition accordingly
 
Set colEnclosures = objWMIService.ExecQuery("Select * from Win32_SystemEnclosure") 
 
   For Each objEnclosure in colEnclosures
      For Each intChassisType in objEnclosure.ChassisTypes
 
Select Case intchassistype
 Case "1" : strchassistype = "(1)Other"
 Case "2" : strchassistype = "(2)Unknown"
 Case "3" : strchassistype = "(3)Desktop"
 Case "4" : strchassistype = "(4)Low Profile Desktop"
 Case "5" : strchassistype = "(5)Pizza Box"
 Case "6" : strchassistype = "(6)Mini Tower"
 Case "7" : strchassistype = "(7)Tower"
 Case "8" : strchassistype = "(8)Portable"
 Case "9" : strchassistype = "(9)Laptop"
 Case "10" : strchassistype = "(10)Notebook"
 Case "11" : strchassistype = "(11)Hand Held"
 Case "12" : strchassistype = "(12)Docking Station"
 Case "13" : strchassistype = "(13)All in One"
 Case "14" : strchassistype = "(14)Sub Notebook"
 Case "15" : strchassistype = "(15)Space-Saving"
 Case "16" : strchassistype = "(16)Lunch Box"
 Case "17" : strchassistype = "(17)Main System Chassis"
 Case "18" : strchassistype = "(18)Expansion Chassis"
 Case "19" : strchassistype = "(19)SubChassis"
 Case "20" : strchassistype = "(20)Bus Expansion Chassis"
 Case "21" : strchassistype = "(21)Peripheral Chassis"
 Case "22" : strchassistype = "(22)Storage Chassis"
 Case "23" : strchassistype = "(23)Rack Mount Chassis"
 Case "24" : strchassistype = "(24)Sealed-Case PC"
 Case else : strchassistype = "(Undefined)"
End Select
 
'Find the model
 
 Set colComputerSystems = objWMIService.ExecQuery("Select * from Win32_ComputerSystem")
 For Each objComputerSystem in colComputerSystems
   strManufacturer = objComputerSystem.Manufacturer
   strModelA = objComputerSystem.Model
 Next
 
 strModel = Left(strModelA,4)  'Extract first four digits of model number
 
Select Case strModel
 
  Case "8171":desc="S51 Desktop"
  Case "8143":desc="M51 Desktop"
  Case "6223":desc="Zpro Desktop"
  Case "9228":desc="ZPro Desktop"
  Case "8811":desc="M55 Tower"
  Case "8808":desc="M55 SFF"
  Case "6072":desc="M57 SFF"
  Case "6075":desc="M57 Tower"
  Case "6234":desc="M58p SFF"
  Case "6209":desc="M58p Tower"
  Case "2672":desc="X32 Laptop no Fingerprint sensor"
  Case "2668":desc="T43 Laptop with Fingerprint sensor"
  Case "2008":desc="T60P Laptop with Fingerprint sensor"
  Case "1707":desc="X60 Laptop with Fingerprint sensor"
  Case "7674":desc="X61 Laptop with Fingerprint sensor"
  Case "6457":desc="T61P Laptop with Fingerprint sensor"
  Case "7459":desc="X200 Laptop with Fingerprint sensor"
  Case "2055":desc="T500 Laptop with Fingerprint sensor"
  Case "2056":desc="T500 Laptop with Fingerprint sensor"
  Case "1866":desc="X41T Tablet with Fingerprint sensor"
  Case "7763":desc="X61T Tablet with Fingerprint sensor"
  Case "CF-U":desc="CF-U1 Ruggedised Portable"
  Case "HP x":desc="HP xw8600 Workstation"
  Case "HP Z":desc="HP Z800 Workstation"
  Case "VMwa":desc="VMware Virtual Platform"
 
End Select
 
 
   Next
      Next
 
'Get the serial number
Set colSMBIOS = objWMIService.ExecQuery ("Select SerialNumber from Win32_SystemEnclosure")
For Each objSMBIOS in colSMBIOS
strSerial=objSMBIOS.SerialNumber
'Wscript.Echo "Serial Number: " & objSMBIOS.SerialNumber
Next
 
'Display the result
'msgbox "Manufacturer = " & strManufacturer & chr(13) & chr(10) &"Model = " & strModelA & chr(13) & chr(10) &"Description = "&desc& chr(13) & chr(10) & "WMI Type = "&strChassisType & chr(13)& chr(10) & "Serial Number = " & strSerial,4160,ver
msgbox "Manufacturer = " & strManufacturer & chr(13) & chr(10) &"Model = " & strModelA & chr(13) & chr(10) & "WMI Type = "&strChassisType & chr(13)& chr(10) & "Serial Number = " & strSerial,4160,ver
 
yesno = msgbox ("Do you want to save this information to a file",4100,ver)
 
if yesno = 6 then 
Set f = fso.OpenTextFile(strManufacturer&"+"&strModelA&".txt", ForWriting, True)
f.writeline "Manufacturer = " & strManufacturer
f.writeline "Model = " & strModelA
' f.writeline "Description = "&desc
f.writeline "WMI Type = "&strChassisType
f.writeline "Asset Tag = " & strSerial
f.close
msgbox "Information written to "&strManufacturer&"+"&strModelA&".txt",4160,ver
end if

If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.