How to determine if laptop or desktop?

  • Thread starter Thread starter Paul Twomey
  • Start date Start date
P

Paul Twomey

Hi, Does anyone know a registry value or other method that
I can use to determine if a Win2K PC is a laptop or
desktop?
Thanks very much
Paul
 
Paul said:
Hi, Does anyone know a registry value or other method that
I can use to determine if a Win2K PC is a laptop or
desktop?

Hi

Two ways that I know of:

1)
If all the laptops have PcCard available, checking for the value
HKLM\SYSTEM\CurrentControlSet\Services\Pcmcia\Start should be good enough I
think.

sChassisType = GetChassis()
WScript.Echo sChassisType

Function GetChassis()
Set oShell = CreateObject("WScript.Shell")

' Init value
sDesc = "Desktop"
On Error Resume Next
iValue =
oShell.RegRead("HKLM\SYSTEM\CurrentControlSet\Services\Pcmcia\Start")

If Err.Number = 0 And iValue = 0 Then
sDesc = "Laptop"
End If
On Error Goto 0
GetChassis = sDesc
End Function


2)
With WMI installed (included in Win2k/XP/can be installed on Win9x/NT4) and a
BIOS that follows the System Management BIOS Reference Specification (SMBIOS
aka
DMIBIOS), you also can check the "ChassisTypes" property under
"Win32_SystemEnclosure" to get some idea of what type of PC you have. My Dell
Latitude is reported as value 8 (= Portable).

Platform SDK: Windows Management Instrumentation
Win32_SystemEnclosure:
http://msdn.microsoft.com/library/en-us/wmisdk/wmi/win32_systemenclosure.asp


VBScript code example for Win32_SystemEnclosure:

From: Torgeir Bakken
Subject: Re: how to distinguish between laptop and desktop
Newsgroups: microsoft.public.windowsxp.setup_deployment
http://groups.google.com/[email protected]
 
Paul said:
Hi, Does anyone know a registry value or other method that
I can use to determine if a Win2K PC is a laptop or
desktop?

Hi

Two ways that I know of:

1)
If all the laptops have PcCard available, checking for the value
HKLM\SYSTEM\CurrentControlSet\Services\Pcmcia\Start should be good enough I
think.

sChassisType = GetChassis()
WScript.Echo sChassisType

Function GetChassis()
Set oShell = CreateObject("WScript.Shell")

' Init value
sDesc = "Desktop"
On Error Resume Next
iValue =
oShell.RegRead("HKLM\SYSTEM\CurrentControlSet\Services\Pcmcia\Start")

If Err.Number = 0 And iValue = 0 Then
sDesc = "Laptop"
End If
On Error Goto 0
GetChassis = sDesc
End Function


2)
With WMI installed (included in Win2k/XP/can be installed on Win9x/NT4) and a
BIOS that follows the System Management BIOS Reference Specification (SMBIOS
aka
DMIBIOS), you also can check the "ChassisTypes" property under
"Win32_SystemEnclosure" to get some idea of what type of PC you have. My Dell
Latitude is reported as value 8 (= Portable).

Platform SDK: Windows Management Instrumentation
Win32_SystemEnclosure:
http://msdn.microsoft.com/library/en-us/wmisdk/wmi/win32_systemenclosure.asp


VBScript code example for Win32_SystemEnclosure:

From: Torgeir Bakken
Subject: Re: how to distinguish between laptop and desktop
Newsgroups: microsoft.public.windowsxp.setup_deployment
http://groups.google.com/[email protected]
 
Thanks very much. Do you know how I query WMI?
-----Original Message-----


Hi

Two ways that I know of:

1)
If all the laptops have PcCard available, checking for the value
HKLM\SYSTEM\CurrentControlSet\Services\Pcmcia\Start should be good enough I
think.

sChassisType = GetChassis()
WScript.Echo sChassisType

Function GetChassis()
Set oShell = CreateObject("WScript.Shell")

' Init value
sDesc = "Desktop"
On Error Resume Next
iValue =
oShell.RegRead ("HKLM\SYSTEM\CurrentControlSet\Services\Pcmcia\Start")

If Err.Number = 0 And iValue = 0 Then
sDesc = "Laptop"
End If
On Error Goto 0
GetChassis = sDesc
End Function


2)
With WMI installed (included in Win2k/XP/can be installed on Win9x/NT4) and a
BIOS that follows the System Management BIOS Reference Specification (SMBIOS
aka
DMIBIOS), you also can check the "ChassisTypes" property under
"Win32_SystemEnclosure" to get some idea of what type of PC you have. My Dell
Latitude is reported as value 8 (= Portable).

Platform SDK: Windows Management Instrumentation
Win32_SystemEnclosure:
http://msdn.microsoft.com/library/en- us/wmisdk/wmi/win32_systemenclosure.asp


VBScript code example for Win32_SystemEnclosure:

From: Torgeir Bakken
Subject: Re: how to distinguish between laptop and desktop
Newsgroups: microsoft.public.windowsxp.setup_deployment
http://groups.google.com/groups?selm=3D57F055.56BF53EB% 40hydro.com


--
torgeir
Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of the 1328 page
Scripting Guide: http://www.microsoft.com/technet/scriptcenter


.
 
Thanks very much. Do you know how I query WMI?
-----Original Message-----


Hi

Two ways that I know of:

1)
If all the laptops have PcCard available, checking for the value
HKLM\SYSTEM\CurrentControlSet\Services\Pcmcia\Start should be good enough I
think.

sChassisType = GetChassis()
WScript.Echo sChassisType

Function GetChassis()
Set oShell = CreateObject("WScript.Shell")

' Init value
sDesc = "Desktop"
On Error Resume Next
iValue =
oShell.RegRead ("HKLM\SYSTEM\CurrentControlSet\Services\Pcmcia\Start")

If Err.Number = 0 And iValue = 0 Then
sDesc = "Laptop"
End If
On Error Goto 0
GetChassis = sDesc
End Function


2)
With WMI installed (included in Win2k/XP/can be installed on Win9x/NT4) and a
BIOS that follows the System Management BIOS Reference Specification (SMBIOS
aka
DMIBIOS), you also can check the "ChassisTypes" property under
"Win32_SystemEnclosure" to get some idea of what type of PC you have. My Dell
Latitude is reported as value 8 (= Portable).

Platform SDK: Windows Management Instrumentation
Win32_SystemEnclosure:
http://msdn.microsoft.com/library/en- us/wmisdk/wmi/win32_systemenclosure.asp


VBScript code example for Win32_SystemEnclosure:

From: Torgeir Bakken
Subject: Re: how to distinguish between laptop and desktop
Newsgroups: microsoft.public.windowsxp.setup_deployment
http://groups.google.com/groups?selm=3D57F055.56BF53EB% 40hydro.com


--
torgeir
Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of the 1328 page
Scripting Guide: http://www.microsoft.com/technet/scriptcenter


.
 
Paul said:
Thanks very much. Do you know how I query WMI?

My last link in my previous post was to a vbscript example querying WMI's
ChassisTypes property in the Win32_SystemEnclosure class.
 
Paul said:
Thanks very much. Do you know how I query WMI?

My last link in my previous post was to a vbscript example querying WMI's
ChassisTypes property in the Win32_SystemEnclosure class.
 
Back
Top