Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

is it a Laptop or Desktop

Status
Not open for further replies.

mwiner

IS-IT--Management
Oct 24, 2002
266
US
Is there a way I can use a script maybe WMI or something to figure out if a machine is a laptop or a desktop?

Thanks!
 
From
Dim oEnclosures, oEnclosure, iEncType

Set oEnclosures = GetObject("winmgmts:").InstancesOf("Win32_SystemEnclosure")
For Each oEnclosure In oEnclosures
iEncType = oEnclosure.ChassisTypes(0)
If num = 3 then
MsgBox "This is a desktop"
Else
If Num = 9 Then MsgBox "This is a laptop"
End If
Next



Read about it at
ChassisTypes Value Meaning
1 Other
2 Unknown
3 Desktop
4 Low Profile Desktop
5 Pizza Box
6 Mini Tower
7 Tower
8 Portable
9 Laptop
10 Notebook
11 Hand Held
12 Docking Station
13 All in One
14 Sub Notebook
15 Space-Saving
16 Lunch Box
17 Main System Chassis
18 Expansion Chassis
19 SubChassis
20 Bus Expansion Chassis
21 Peripheral Chassis
22 Storage Chassis
23 Rack Mount Chassis
24 Sealed-Case PC
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top