-----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
.