Above won't work for unmounted volumes, there's no bulletproof correlation between disks (physical) and volumes (software) since volumes can spawn multiple disks for dynamic, sparse, raid etc. With that in mind, to "find the disc number of a disc whose volume label we know", windows 11,10,8 is needed (edit: namespace not supported on 7): Code: set "label=MEDIA" set q1= $Q1=(gwmi Win32_Volume -filter $('Label='+[char]34+$env:label+[char]34)).DeviceID set q2= $Q2=(gwmi MSFT_Partition -Namespace root\Microsoft\Windows\Storage ^|where {$_.AccessPaths -contains $Q1}).DiskNumber for /f %%s in ('powershell -nop -c "%q1%; if ($Q1) {%q2%; $Q2}"') do set disk=%%s echo %disk% pause