Get only information from PHYSICALDRIVE0.
Posted: 08 Nov 2019 07:32
Good morning,
I have spent hours on the following which works fine if a USB or external HDD is NOT attached . . .
If there IS a USB or external HDD attached, it shows the USB or external HDD data instead of the C:\ drive data.
I have tried using PHYSICALDRIVE0 and wmic Path win32_PhysicalMedia Get, etc, but to no avail.
I have spent hours on the following which works fine if a USB or external HDD is NOT attached . . .
Code: Select all
For /f "Tokens=2 Delims==" %%a In ('wmic DiskDrive Get Caption /Value') Do Set "PC_HDDMakeModel=%%a"
For /f "Tokens=2 Delims='='" %%a In ('wmic LogicalDisk Get Description /Value') Do Set "PC_HDDMediaType=%%a"
For /f "Tokens=2 Delims='='" %%a In ('wmic DiskDrive Get Partitions /Value') Do Set PC_HDDPartitions=%%a
For /f "Tokens=2 Delims='='" %%a In ('wmic DiskDrive Get Status /Value') Do Set PC_HDDStatus=%%a
I have tried using PHYSICALDRIVE0 and wmic Path win32_PhysicalMedia Get, etc, but to no avail.