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.

15 lines
536 B

  1. '***************************************************************************
  2. 'This script tests the enumeration of instances
  3. '***************************************************************************
  4. On Error Resume Next
  5. Set Disks = GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf ("CIM_LogicalDisk")
  6. WScript.Echo "There are", Disks.Count, " Disks"
  7. Set Disk = Disks("Win32_LogicalDisk.DeviceID=""C:""")
  8. WScript.Echo Disk.Path_.Path
  9. if Err <> 0 Then
  10. WScript.Echo Err.Description
  11. Err.Clear
  12. End if