OSD_IsDesktop

OSD_IsDesktop()

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 desktop, gbValue will return TRUE otherwise it will return FALSE.

Chasis types considered as desktops

CHASSIS TYPE

DESCRIPTION

3

Desktop

4

Low Profile Desktop

6

Mini Tower

24

Sealed-Case PC

Remarks

This function is called by OSD_Initialize, and the result is stored in the global variable gbIsDesktop.

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_IsLaptop, OSD_IsServer, Dialog_ShowInformation