Velvet Star Monitor

Standout celebrity highlights with iconic style.

news

What is the difference between properties `Name`, `Caption` and `DeviceID` (when executing `wmic LogicalDisk`)?

Writer Emily Wong

When executing the command line wmic LogicalDisk, several properties of all logical disks of the computer system are returned. Three of them are Name, Caption and DeviceID, having the same value per drive, namely the drive letter C:, D:, etc.

What is the difference between these properties? Which one always returns the drive letter that I can access the respective drive with in the console cmd?

0

1 Answer

==> wmic logicaldisk get Caption, DeviceID, Name
Caption DeviceID Name
C: C: C:
D: D: D:
E: E: E:
==>

Pay your attention to each property Qualifiers in Win32_LogicalDisk class documentation:

Caption

  • Data type: string
  • Access type: Read-only
  • Qualifiers: MaxLen (64), DisplayName ("Caption")
  • Short description of the object—a one-line string. This property is inherited from CIM_ManagedSystemElement.

DeviceID

  • Data type: string
  • Access type: Read-only
  • Qualifiers: Key, Override ("DeviceId"), MappingStrings ("WMI")
  • Unique identifier of the logical disk from other devices on the system. This property is inherited from CIM_LogicalDevice.

Name

  • Data type: string
  • Access type: Read-only
  • Qualifiers: DisplayName ("Name")
  • Label by which the object is known. When subclassed, this property can be overridden to be a key property. This property is inherited from CIM_ManagedSystemElement.

Key Qualifier is fundamental:

The Key qualifier indicates whether the property is part of the namespace handle.

Moreover, there is next important note inside the former link:

The Get Disk info using wmi/cim... do it the right way PowerShell code example on the TechNet Gallery uses Win32_LogicalDisk to retrieve DeviceID, VolumeName, and Size from a target device. In particular, this sample includes rigorous exception handling, and returns a single object per computer, rather than per disk.

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy