You can use PowerShell!
To get the info on a drive from a single partition's drive letter:
Get-Disk (Get-Partition -DriveLetter 'C').DiskNumber
It produces output like this:
Number Friendly Name Serial Number HealthStatus OperationalStatus Total Size Partition
Style
------ ------------- ------------- ------------ ----------------- ---------- ----------
0 WDC WD7500... <redacted> Healthy Online 698.64 GB GPT
You can tack on a | Format-List
to the original command to get an easier-to-read result with more info:
UniqueId : <redacted>
Number : 0
Path : \\?\scsi<redacted>
Manufacturer :
Model : WDC WD7500BPVX-60JC3T0
SerialNumber : <redacted>
Size : 698.64 GB
AllocatedSize : 750151131136
LogicalSectorSize : 512
PhysicalSectorSize : 4096
NumberOfPartitions : 6
PartitionStyle : GPT
IsReadOnly : False
IsSystem : True
IsBoot : True
To get some info on the drive of each partition:
Get-Partition | % {New-Object PSObject -Property @{'PartitionNumber'=$_.PartitionNumber; 'DiskNumber'=$_.DiskNumber; 'DiskModel'=(Get-Disk $_.DiskNumber).Model; 'PartitionSize'=$_.Size; 'DriveLetter'=$_.DriveLetter}}
It produces a collection of PowerShell objects that you can use like those you get out of real cmdlets. When printed to the screen, its output looks like this (some partitions edited out to save vertical space):
DriveLetter :
DiskNumber : 0
DiskModel : WDC WD7500BPVX-60JC3T0
PartitionSize : 681574400
PartitionNumber : 1
DriveLetter : C
DiskNumber : 0
DiskModel : WDC WD7500BPVX-60JC3T0
PartitionSize : 726793488384
PartitionNumber : 4
DriveLetter : D
DiskNumber : 0
DiskModel : WDC WD7500BPVX-60JC3T0
PartitionSize : 21351104512
PartitionNumber : 6
diskpart
to print anything at all. It also resists interactive usage attempts (it tries to open in a separate graphical window, which it then immediately closes). I tried putting it in a foo.bat file followed bypause
command, but it just doesn't display any output whatsover.