1 '===========================
2 'Name: DisplayClassProperties.vbs
3 'Author:jevan
4 'Date: 2011-3-1
5
6 'Arguments:
7 '枚举出这个类的所有属性
2 'Name: DisplayClassProperties.vbs
3 'Author:jevan
4 'Date: 2011-3-1
5
6 'Arguments:
7 '枚举出这个类的所有属性
8 '=============================
9 Option Explicit
10 On Error Resume Next '调试状态请把这行注销
11 Dim strComputer
12 Dim strWMINamespace
13 Dim strWMIquery
14 Dim objWMIService
15 Dim colItems
16 Dim objItem
17 strComputer="."
18 strWMINamespace="\root\CIMV2"
19 strWMIquery=":Win32_BootConfiguration" '":Win32_TimeZone" '注意冒号
20 Set objWMIService=GetObject("winmgmts:\\"&strComputer _
21 & strWMINamespace & strWMIQuery)
22 WScript.Echo "Number of properties of" &strWMIQuery _
23 &" class is " &objWMIService.Properties_.count
24 For Each objItem In objWMIService.Properties_
25 WScript.Echo "Property : "&objItem.name
26 Next
9 Option Explicit
10 On Error Resume Next '调试状态请把这行注销
11 Dim strComputer
12 Dim strWMINamespace
13 Dim strWMIquery
14 Dim objWMIService
15 Dim colItems
16 Dim objItem
17 strComputer="."
18 strWMINamespace="\root\CIMV2"
19 strWMIquery=":Win32_BootConfiguration" '":Win32_TimeZone" '注意冒号
20 Set objWMIService=GetObject("winmgmts:\\"&strComputer _
21 & strWMINamespace & strWMIQuery)
22 WScript.Echo "Number of properties of" &strWMIQuery _
23 &" class is " &objWMIService.Properties_.count
24 For Each objItem In objWMIService.Properties_
25 WScript.Echo "Property : "&objItem.name
26 Next