Skip to content

OSD\_IsDesktop

VB Scripting Library > OSD Scripting Library > OSD functions (OSD)

Detects the chassis type from the WMI Win32_SystemEnclosure class.

No arguments provided.

Boolean, TRUE if function completed successfully.
If the computer chassis is a desktop, gbValue will return TRUE otherwise it will return FALSE.

CHASSIS TYPEDESCRIPTION
3Desktop
4Low Profile Desktop
6Mini Tower
24Sealed-Case PC

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

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

Scripting Guidelines, OSD_IsLaptop, OSD_IsServer, Dialog_ShowInformation