OSD_IsLaptop
OSD_IsLaptop()
Detects the chassis type from the WMI Win32_SystemEnclosure class.
Arguments
No arguments provided.
Return Type
Boolean, TRUE if function completed successfully.
If the computer chassis is a laptop, gbValue will return TRUE otherwise it will return FALSE.
Chasis types considered as laptops
CHASSIS TYPE | DESCRIPTION |
---|---|
9 | Laptop |
10 | Notebook |
11 | Hand Held |
14 | Sub Notebook |
Remarks
This function is called by OSD_Initialize, and the result is stored in the global variable gbIsLaptop.
Example
The following script will use the global variables, set by the calls to this function from the OSD_Initialize() function, to display a message to the user that tells the detected chassis type.
Private Function IncludeScript(sScriptFile) '... End Function 'Begin bStatus=True If bStatus Then bStatus=IncludeScript("customlib.cis") If bStatus Then bStatus=IncludeLibrary("Capalib.cin") If bStatus Then bStatus=IncludeLibrary("Osdlib.cin") If bStatus Then bStatus=Job_Start("WS","Script Name","1.0","ScriptName.log","INSTALL") If bStatus Then bStatus=OSD_Initialize() 'This function calls this function and sets the global varliables gbIsLaptop, gbIsDesktop, gbIsServer If gbIsLaptop Then sMsg="This is a Laptop" If gbIsDesktop Then sMsg="This is a desktop" If gbIsServer Then sMsg="This is a server" If bStatus Then bStatus=Dialog_ShowInformation(sMsg) Job_End(bStatus) 'End main
See Also
IncludeScript function, OSD_IsDesktop, OSD_IsServer, Dialog_ShowInformation