Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

16 lines
536 B

'***************************************************************************
'This script tests the enumeration of instances
'***************************************************************************
On Error Resume Next
Set Disks = GetObject("winmgmts:{impersonationLevel=impersonate}").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