2025-04-27 07:49:33 -04:00

11 lines
451 B
JavaScript

// The following sample enumerates all instances of the class
// Win32_LogicalDisk, and extract the the member with a specified
// relative path.
var objServices = GetObject('cim:root/cimv2');
var objEnum = objServices.ExecQuery ('select * from Win32_LogicalDisk');
// Note that the Item method is the default method of this interface
var objInstance = objEnum ('Win32_LogicalDisk="C:"');
WScript.Echo (objInstance.Path_.DisplayName);