I have a txt file with volume id.
I need to get disk information (drive letter, disk size, etc.) from the disk volume identifier (Windows):
The volume identifier is in the following format:
\\?\Volume{XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
The drive can be a removable / local drive
It does not matter how the information is extracted (it can be a script, cpp, C #, java code).
EDIT:
I tried to use DriveInfo, Win32_LogicalDisk, Win32_Volume, Win32_PnpDevices - but I could not find this strange identifier ... in all cases the id has a differentrent format
UPDATE:
Learned how to do it.
you can list Win32_Volume as follows:
ManagementObjectSearcher ms = new ManagementObjectSearcher("Select * from Win32_Volume"); foreach(ManagementObject mo in ms.Get()) { var guid = mo["DeviceID"].ToString(); if(guid == myGuid) return mo["DriveLetter"]; }
source share