Wmic Diskdrive Get Serialnumber
Posted By admin On 07.05.20- 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.
- 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.
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.
- Open a new instance of the command prompt.
- 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
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 Hiemstra3 Answers
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.
this issue occurs because the XML parser treats the control characters that are included in the serial number of some drives as invalid.
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:
Get the ID of each drive:
wmic diskdrive get deviceid /format:list
Parse the output and get the first ID. In my case this was
.PHYSICALDRIVE0
Escape the backslashes so that the ID is
.PHYSICALDRIVE0
Get the serial number of the drive using its escaped ID:
wmic diskdrive where deviceid='.PHYSICALDRIVE0' getserialnumber /format:list
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