Wmic Diskdrive Get Serialnumber

Posted By admin On 07.05.20
  1. WMIC or Windows Management Interface Command is a simple command line tool used to issue WMI commands. WMI command generally used to query all of the system related information like Computer Name, BIOS Serial Number, Mac Address etc.
  2. Get serial number for RAM, motherboard, hard disk. This post explains how to find serial number for various hardware devices – RAM, Hard disk, Motherboard on a computer. wmic diskdrive get serialnumber SerialNumber FR3AG13032430BC13S Get serial number for mother boards wmic baseboard get serialnumber.
  1. Wmic Diskdrive Get Serialnumber Code
  2. Wmic Get Hard Drive Info
  3. Wmic Diskdrive Get Serialnumber C#

Short for 'WMI console,' wmic is a command line command to query WMI (Windows Management Instrumentation) entries. Note Beginning in 2012, WMIC is deprecated in favor of PowerShell cmdlets which perform equivalent CIM operations, such as get-wmiobject, invoke-wmimethod, Get-wmiobject, and gwmi.

Sometimes you need to quickly find the interface through which your storage is connected inside your PC, and its serial number and a set of other properties. With a single console command you can retrieve a lot of information about your disk drive. Let's see how it can be done.

RECOMMENDED: Click here to fix Windows errors and optimize system performance


There is a special WMIC command which utilizes Windows Management Instrumentation (WMI) to provide information about all storage devices you have installed in Windows. It works in all modern Windows versions including Windows 10. You can use it as follows.
  1. Open a new instance of the command prompt.
  2. Type or copy-paste the following command:

    It will give you information about the storage devices you have. This is usually not visible without third party tools.

In my case, the output is as follows:The full list of properties that you can use for the query above is as follows:

  • Availability
  • BytesPerSector
  • Capabilities
  • CapabilityDescriptions
  • Caption
  • CompressionMethod
  • ConfigManagerErrorCode
  • ConfigManagerUserConfig
  • CreationClassName
  • DefaultBlockSize
  • Description
  • DeviceID
  • ErrorCleared
  • ErrorDescription
  • ErrorMethodology
  • FirmwareRevision
  • Index
  • InstallDate
  • InterfaceType
  • LastErrorCode
  • Manufacturer
  • MaxBlockSize
  • MaxMediaSize
  • MediaLoaded
  • MediaType
  • MinBlockSize
  • Model
  • Name
  • NeedsCleaning
  • NumberOfMediaSupported
  • Partitions
  • PNPDeviceID
  • PowerManagementCapabilities
  • PowerManagementSupported
  • SCSIBus
  • SCSILogicalUnit
  • SCSIPort
  • SCSITargetId
  • SectorsPerTrack
  • SerialNumber
  • Signature
  • Size
  • Status
  • StatusInfo
  • SystemCreationClassName
  • SystemName
  • TotalCylinders
  • TotalHeads
  • TotalSectors
  • TotalTracks
  • TracksPerCylinder

You can find their descriptions at the following MSDN page: Win32_DiskDrive.

WMIC is a really useful tool to perform WMI queries in Windows. Here are a few more examples of such queries:

  • Get all network adapter details in Windows 10 with this command.

That's it.

RECOMMENDED: Click here to fix Windows errors and optimize system performance

Diskdrive
Active5 years, 2 months ago

I want to read the name and the serialnumber of my Hard-Drives.

I stumbled upon wmic but i'm having troubles. I guess these two commands should do the trick, but I only get the message:

or

I tried the following aswell:

Wmic Diskdrive Get Serialnumber Code

Any ideas on what I'am doing wrong?

Solution:

Thanks JPBlanc,via the /? command i've found out that SerialNumber doesn't even exist. I now use

which gives the correct result.

Paul Hiemstra
50.4k10 gold badges118 silver badges136 bronze badges
user1210404user1210404

3 Answers

Wmic Diskdrive Get Serialnumber

You are just making a mistake usin WMIC command line, WMIC DISKDRIVE GET SerialNumber /Format /? gives you keywords:

you can try :

You can replace RAWXML by one of the others formats.

JPBlancJPBlanc
55.2k11 gold badges101 silver badges136 bronze badges

this issue occurs because the XML parser treats the control characters that are included in the serial number of some drives as invalid.

juejue

I was getting this error on Windows 7 x86 Pro (where querying the serial number should be possible) when an external drive was connected.

This is how I fixed it:

  1. Get the ID of each drive: wmic diskdrive get deviceid /format:list

  2. Parse the output and get the first ID. In my case this was.PHYSICALDRIVE0

  3. Escape the backslashes so that the ID is .PHYSICALDRIVE0

  4. Get the serial number of the drive using its escaped ID:

    wmic diskdrive where deviceid='.PHYSICALDRIVE0' getserialnumber /format:list

  5. Repeat steps 2 - 4 until you have the serial numbers of all drives

Java generate pdf from html word. Edit: The above doesn't work on my copy of Windows XP x86 Pro. Autocad lt.

Wmic Get Hard Drive Info

This does:

Matthias BraunMatthias Braun
16.2k12 gold badges89 silver badges125 bronze badges

Wmic Diskdrive Get Serialnumber C#

Not the answer you're looking for? Browse other questions tagged wmiserial-numberwmic or ask your own question.