WMISimpleQuery - Example

For a given drive the free disk space is to be determined. This drive is the drive with the letter C:, i.e. , the query is Caption=C:.
The data is then retrieved only if the C: drive is present.

Script:

WMISimpleQuery('\\.\root\cimv2','WIN32_LOGICALDISK','Caption=C:','WMI_')

 Caption

 FreeSpace

EndProc

If %WMI_Caption%<>''

 MsgBox

  %WMI_Caption% drive still has %WMI_FreeSpace% bytes of free disk space.

 EndProc

Else

 MsgBox

  Drive not found!

 EndProc