Windows how to find disk number of mounted VHD?

Q. Once you mount a VHD on Windows, how to find the disk number ‘n’ of the mounted vhd? This is required to access the mounted VHD in the disk form as \\.\PhyiscalDriven.


Use below diskpart command, it lists all the mounted VHDs and their corresponding disk numbers.

DISKPART> list vdisk
VDisk ### Disk ### State Type File
 --------- -------- -------------------- --------- ----
 VDisk 0 Disk 2 Attached not open Expandable S:\UBMD.vhd
 VDisk 1 Disk 1 Attached not open Expandable C:\resOCB\test_0.vhd

From the example S:\UBMD.vhd is mounted at disk number 2 and C:\resOCB\test_0.vhd is mounted at disk number 1.