Wmic Hard Drive Serial

  • Jul 19, 2018  To find Hard Disk Serial Number in Windows 10, do the following. Open an elevated command prompt. Type or copy-paste the following command: wmic diskdrive get Name, Manufacturer, Model, InterfaceType, MediaType, SerialNumber. In the output, you'll see the model, name, and serial number listed for the installed hard drives.
  • Getting Serial Number of the Hard Drive Provided by the manufacturer through PHP: How can it be done? I want to store it in a file. OS: windows 2000,XP,ME,Vista. Yes, I want the serial numb.
  • This post explains how to find serial number for various hardware devices – RAM, Hard disk, Motherboard on a computer. We can use WMIC command to find this information. These commands can be executed from Windows command prompt. Get serial number of RAM chips.
  • For get the serial number of all hard drives in my computer, I use: wmic diskdrive get serialnumber But, I want to get the serial number of the hard drive where I am working. I explain: I have 2 hard drives, one of them has 2 partitions C and D. The other has one partition E.
  1. Wmic Diskdrive Serial Number
  2. Hard Drive Wmic Diskdrive Get Serialnumber

Oct 02, 2018  4. Then, please type 'wmic disk drive drive SerialNumber' and then press enter. Like the picture below. So, the results immediately appear. You can immediately see the serial number on your hard drive. Is Only a Serial Number Hard Disk That Can Be. Jul 23, 2017  Retrieving Hard Drive Serial Number via WMIC. 2014 at 14:41 UTC. IT Programming. Next: Wait Process Window to be Activate. Get answers from your peers along with millions of IT pros who. I've been told that we are going to need to record the hard drive serial number as well and I would like to add it to my script but I'm.

Active1 year, 11 months ago

Getting Serial Number of the Hard Drive Provided by the manufacturer through PHP : How can it be done?I want to store it in a file.

Shrink partition windows 7 command line. OS : windows 2000,XP,ME,Vista..

Yes, I want the serial number of the hard drive of the Server.

Or can it be done through Adobe AIR?Or can it be done through a C program on Windows?

Is this number : BC16-5d5f unique for a hard drive?How is it different from the manufacturer given serial number?

Displays only the following text on my Vista Machine:

SerialNumber

On my XP machine, the command is unrecognized.

Speed Test Gadget 1.0.20. With Speed Test you can monitor CPU (over 8 cores). By itself and it has the ability to; - Maximum bandwidth (Internet Speed Test). How To Test your system performance in Windows 7. Now click on 'Rate this computer'. The system will then begin to run some tests. This will take about 1-2 minutes. The Windows Experience Index assesses key system components on a scale of 1.0 to 7.9. This video will benefit those viewers who use a Windows 7. It's never been faster or easier to take a Speedtest. Download the free Speedtest desktop app for Windows to check your internet speeds at the touch of a button. Test wifi speed windows 7. Jul 06, 2012  The PCMark 7 benchmark runs 7 system tests, each designed to represent a certain type of PC usage, including hard disk access, 3D and graphics physics rendering, Web page rendering, file.

Andreas Niedermair
16.5k7 gold badges66 silver badges113 bronze badges
dharm0usdharm0us
5,51522 gold badges75 silver badges123 bronze badges

9 Answers

The following returns the disk serial number. Should work with multiple drives, you'll just get multiple results. Just run it with shell_exec.

wmic.exe is located in your windows system32 folder. And wmic does exist on WinXP, Ive used it there myself.

My result on Vista:

I do not know if all harddrives provides the serial number to the OS.

It seems the wmic command is only available on the professional versions of Windows XP, Windows Vista and Windows 7.

OISOIS

PHP itself has no way of accessing the hardware like that.

You will have to either

  • use a command of your operating system and call it with system() or exec()
  • write an extension for PHP that will return you the information

If you are on Linux and have the necessary privileges and configuration you can use $r = system('hdparm -I /dev/hda'); (replace hda with your hd) to get the serial number of a given hard drive.

Patrick GlandienPatrick Glandien
6,5855 gold badges35 silver badges46 bronze badges

that's on linux, not sure on windows though. You could execute that via 'system()'

Have a look at http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.hk.msdn.connection&tid=e41f0af2-2e76-4be6-9b7b-636e79ac0491&cat=zh_HK_3b03d742-993a-4f96-accd-1063c6bfd559&lang=zh&cr=HK&sloc=&p=1

Might be a way forward.

Also, when I ran a 'dir' on the command prompt, it shows:

Is that what you're looking for?

Andrei Serdeliuc ॐAndrei Serdeliuc ॐ
4,4834 gold badges33 silver badges63 bronze badges

I can't tell you the answer, but I guess you'll have to look in the direction of extensions (maybe even writing one yourself). I doubt this is something PHP's core has.

Edit: I forgot about the raw power of 'exec' :-/

Bart van HeukelomBart van Heukelom
21.6k52 gold badges157 silver badges278 bronze badges

Run the following with shell_exec (test in command prompt if needed):

DISKDRIVE doesn't get the actual serial number for my drive that shows plugged in through an IDE channel. the above seemed to get the actual serial numbers for all of my drives. Tag will also return you what type of drive it is which may be helpful for identifying different drives.

Example output:

Dustin GDustin G

Do you want the hard drive from the server or a client? PHP runs on the server so getting it straight from the client doens't seem possible to me.

The manual suggest you can execute commands on you server:http://nl2.php.net/manual/en/ref.exec.php

Unfortunately I don't enough Unix to get you hdd serials.

MrHusMrHus
25.5k5 gold badges25 silver badges31 bronze badges

You can use

or

Then you can echo it.

Based on Patrick Daryll Glandien's hint, you can execute following on *nix based machines. $hdserial= hdparm -I /dev/hda

hdparm -i /dev/sda returns lesser info. But as hdparm needs root access, it did not run with php for me.

The '2>&1' part is used from the suggestion here.

Community
LeninLenin
Veeren SharmaVeeren Sharma

On *nix based machine you can also use ls /dev/disk/by-id/ because hdparm need root permission (see Patrick Daryll G. answer).

and you will get something like this

Community
Fery WardiyantoFery Wardiyanto

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

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

Wmic Diskdrive Serial Number

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.

Hard Drive Wmic Diskdrive Get Serialnumber

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