System Info
This example shows accessing system information.
04
Set
wmiSvcObj = GetObject(
"winmgmts:\\"
& strCompName &
"\root\CIMV2"
)
05
Set
selSysInfo = wmiSvcObj.ExecQuery(
"SELECT * FROM Win32_OperatingSystem"
)
07
For
Each
sysInfo
In
selSysInfo
09
WScript.Echo
"System Drive: "
& sysInfo.SystemDrive
10
WScript.Echo
"System Directory: "
& sysInfo.SystemDirectory
11
WScript.Echo
"Windows Directory: "
& sysInfo.WindowsDirectory
13
WScript.Echo
"Boot Device: "
& sysInfo.BootDevice
14
WScript.Echo
"System Device: "
& sysInfo.SystemDevice
It gives the following output,
System Drive: C:
System Directory: C:\WINDOWS\system32
Windows Directory: C:\WINDOWS
Boot Device: \Device\HarddiskVolume1
System Device: \Device\HarddiskVolume1