WMI Classes
Win32_Process, Win32_Service, AntiVirusProduct, Win32_Startup ...
WMI objects are queried using a
SQL like language:
WMI Query Language (WQL).
Most classes are implemented as
providers. Such providers are either
COM dlls or
kernel drivers.
VBScript
The following simple script demonstrates how WMI can be queried with
VBScript:
option explicit
dim winos
set winos = getObject("winmgmts:").instancesOf("Win32_OperatingSystem")
dim rec
for each rec in winos ' {
wScript.echo "Caption: " & rec.caption
wScript.echo "Manufacturer: " & rec.manufacturer
wScript.echo "Build Type: " & rec.BuildType
WScript.echo "Version: " & rec.Version
WScript.echo "Locale: " & rec.Locale
WScript.echo "Windows Directory: " & rec.windowsDirectory
WScript.echo "Total memory: " & round(rec.totalVisibleMemorySize/1024/1024) & " MB"
WScript.echo "Serial Number: " & rec.SerialNumber
Wscript.echo ""
next ' }
C:\users\rene> cscript query-Win32.vbs