I am use this command for finding hard disk in formation "wmic diskdrive" but i insert a external device like hard disk or pan drive, this command is provide information of external hard disk or pan drive. so how can find internal hard disk information where system window installed.
Asked
Active
Viewed 9.5k times
3 Answers
12
It is off topic here , though you can get the info using following cmd
wmic logicaldisk
or ,
diskpart
then list volume

Santhosh
- 8,181
- 4
- 29
- 56
-
1i want serial number and model number of hard disk – Lokesh Kumar Nov 04 '14 at 06:55
-
try this `wmic diskdrive get serialnumber` – Santhosh Nov 04 '14 at 06:58
-
1i have tried this but when i insert pan drive it provide pan drive serial number. by using these command – Lokesh Kumar Nov 04 '14 at 07:12
-
how can get only hard disk serial number?? – Lokesh Kumar Nov 04 '14 at 07:23
-
4`wmic diskdrive get caption,serialnumber` – konserw Jul 20 '16 at 08:53
5
The PowerShell way is:
PS C:\> $Disk = Get-WmiObject -Class Win32_logicaldisk -Filter "DeviceID = 'C:'"
PS C:\> $DiskPartition = $Disk.GetRelated('Win32_DiskPartition')
PS C:\> $DiskDrive = $DiskPartition.GetRelated('Win32_DiskDrive')
PS C:\> $DiskDrive.Size
1024203640320
This is nicely explained here.
But the original question was about how to do this with CMD.
C:\>wmic diskdrive get model,name,size
Model Name Size
SAMSUNG MZVLB1T0HALR-000L7 \\.\PHYSICALDRIVE0 1024203640320
Generic- SD/MMC USB Device \\.\PHYSICALDRIVE1
Given a choice, I prefer to use the PowerShell method, starting from the drive letter and working up to the physical disk. It's rather verbose but it gives a unique answer, and requires no knowledge of the system. (Some devices have many physical disks and it can get confusing.)

Paul Williams
- 3,099
- 38
- 34
2
"find internal hard disk information where system window installed."
wmic logicaldisk where caption="%systemdrive%" get /value
Note: logicaldisk
is a partition on an physical drive (the only one, if you are lucky, but there may be more partitions on the same physical drive)

Stephan
- 53,940
- 10
- 58
- 91