21 lines
634 B
Plaintext
21 lines
634 B
Plaintext
' Copyright (c) Microsoft Corporation, All Rights Reserved
|
|
'***************************************************************************
|
|
'
|
|
' WMI Sample Script - Object Collection (VBScript)
|
|
'
|
|
' This script illustrates how SWbemObjectSet collections are manipulated.
|
|
'
|
|
'***************************************************************************
|
|
On Error Resume Next
|
|
|
|
Set Disks = GetObject("winmgmts:").InstancesOf ("CIM_LogicalDisk")
|
|
|
|
WScript.Echo "There are", Disks.Count, " Disks"
|
|
|
|
Set Disk = Disks("Win32_LogicalDisk.DeviceID=""C:""")
|
|
WScript.Echo Disk.Path_.Path
|
|
|
|
if Err <> 0 Then
|
|
WScript.Echo Err.Description
|
|
Err.Clear
|
|
End if |