And finally here is a solution to get the interface of a drive, through the same wmic.exe. Note that in this case you can't get this information using the drive letter, but using the number of the physical drive (which starts with 0), because the interface isn't related to the partition, but to the physical drive:
Code: Select all
[Rainmeter]
Update=1000
OnRefreshAction=[!CommandMeasure "MeasureRun" "Run"]
DynamicWindowSize=1
[Variables]
DiskDrive=0
[MeasureRun]
Measure=Plugin
Plugin=RunCommand
Parameter=wmic DISKDRIVE get InterfaceType,Name
State=Hide
OutputType=ANSI
RegExpSubstitute=1
Substitute="InterfaceType\s+Name":"","(.*)\s+\\\\\.\\PHYSICALDRIVE#DiskDrive#":"\1","(.*)\s+\\\\\.\\PHYSICALDRIVE0":"","(.*)\s+\\\\\.\\PHYSICALDRIVE1":"","(.*)\s+\\\\\.\\PHYSICALDRIVE2":"","(.*)\s+\\\\\.\\PHYSICALDRIVE3":"","(.*)\s+\\\\\.\\PHYSICALDRIVE4":"","(.*)\s+\\\\\.\\PHYSICALDRIVE5":"","(.*)\s+\\\\\.\\PHYSICALDRIVE6":"","(.*)\s+\\\\\.\\PHYSICALDRIVE7":"","(.*)\s+\\\\\.\\PHYSICALDRIVE8":"","(.*)\s+\\\\\.\\PHYSICALDRIVE9":"","(.*)\s+\\\\\.\\PHYSICALDRIVE10":"","#CRLF#":"","\s+":"","^$":"ERROR"
FinishAction=[!ShowMeter "MeterDrive"]
[MeterDrive]
Meter=String
MeasureName=MeasureRun
X=0
Y=0
Padding=15,5,15,5
FontColor=220,220,220
SolidColor=0,0,0,150
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=%1
Hidden=1
The DiskDrive variable represents the number of the physical drive. As I said, it starts from 0, so for the first drive it is 0, for the second one (if there is a such one) it is 1 and so on. Just add the number representing the drive you'd like to check. With the
wmic DISKDRIVE get InterfaceType,Name command (type or paste it to a command prompt), you'll get a list of the installed drives onto your system. Details:
https://www.lisenet.com/2014/get-windows-system-information-via-wmi-command-line-wmic/ (scroll down to the "Get Information About Physical Drives" section).