OSD\_IsDesktop
VB Scripting Library > OSD Scripting Library > OSD functions (OSD)
OSD_IsDesktop()
Section titled “OSD_IsDesktop()”Detects the chassis type from the WMI Win32_SystemEnclosure class.
Arguments
Section titled “Arguments”No arguments provided.
Return Type
Section titled “Return Type”Boolean, TRUE if function completed successfully.
If the computer chassis is a desktop, gbValue will return TRUE otherwise it will return FALSE.
Chasis types considered as desktops
Section titled “Chasis types considered as desktops”| CHASSIS TYPE | DESCRIPTION |
|---|---|
| 3 | Desktop |
| 4 | Low Profile Desktop |
| 6 | Mini Tower |
| 24 | Sealed-Case PC |
Remarks
Section titled “Remarks”This function is called by OSD_Initialize, and the result is stored in the global variable gbIsDesktop.
Example
Section titled “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 mainSee Also
Section titled “See Also”Scripting Guidelines, OSD_IsLaptop, OSD_IsServer, Dialog_ShowInformation