Hard Drive Serial Number Location

Active2 years, 2 months ago

Serialnumber is where the serial number is stored when you scan. If there is a manual edit to the serialnumber, the original scan value is moved over to bserialnumber, and the edited number is stored in serialnumber. For reporting, you want to use serialnumber. Apr 12, 2016 at 18:01 UTC. Was able to get it.

From the Windows NT-based (Windows XP and 7 specifically) command prompt, how can I get the serial number of a hard drive as a variable? The one I'm looking at is the serial number of the physical hard disk drive

Canadian Luke
Canadian LukeCanadian Luke
18.5k33 gold badges97 silver badges153 bronze badges

4 Answers

vol C:

this will get the volume serial number given to it by windows.

Hard drive serial number location 1948 ford f1 pickup

wmic diskdrive get serialnumber

this gets the manufacturers serial number of the hard drive.

52.6k14 gold badges98 silver badges161 bronze badges
  • What you are looking at is NOT the hard drive serial number.

  • It is called the Volume Serial Number. It is generated at the time of creating and formatting the volume / partition.

  • You can get it by using a command at command prompt : C:> vol c: if C: Utorrent faster download speed. is the drive you want to retrieve the Volume Serial Number for.

  • All you can do is redirect the output of that command to a file : C:> vol c: > myvol.txt and it will be stored as a text file in your C:

    Easily manage your PPC accounts at scale with automated recommendations, unique data views, and fast implementation.Adalysis is built to get you out of data crunching and into optimizations by pointing you directly at what needs to be addressed. Paradox database windows 10.

  • I am attaching a screenshot with the highlights:

  • The file was stored in the root of C:
  • This is what the myvol.txt file looks like in Notepad:

In the same vein as Moab's answer, but using PowerShell this time:

This command gets an instance of the Win32_DiskDrive WMI class and outputs the model of each disk drive in the computer and its corresponding serial number from that instance.

This answer assumes PowerShell 3.0 or later. If running an older version, use Get-WmiObject in place of Get-CimInstance.

On Windows 8 and later, you can also use this command:

37.8k37 gold badges146 silver badges180 bronze badges

In a batch file one approach is:

  1. VOL command to produce the serial number as text along with text we don't want.
  2. FIND to trim it down to only the line with the serial number.
  3. FOR to grab the 5th token (a part between delimiters) on the line with the serial number.
  4. SET to assign to an environment variable

protected by bwDracoFeb 11 '18 at 19:14

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?

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

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.

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?

Aug 11, 2013  Internet Explorer Windows 7 11.0 Windows 7. Security, ease of use, and improvements in RSS, CSS, and Ajax support are Microsoft's priorities for Internet Explorer. This version of IE runs on the 32-bit version of Windows 7. The latest version of the browser includes support for: Accelerators - which allow supported web applications to be invoked without explicitly navigating to them. Mar 05, 2019  However, this best security browser is compatible with Windows 7/8/8.1/10/Vista/XP for both 32/64 – Bit configurations. Download Internet Explorer web browser free for Windows by clicking on the below- download button. Internet Explorer 11 Free Download Overview: Most of the basic programs usually run on Internet Explorer browser. Nov 06, 2013  Internet Explorer 11 for Windows 7. Internet Explorer 11 is the recommended browser for Windows 7. Display: Super VGA (800 x 600) or higher-resolution monitor with 256 colors. Peripherals: Modem or Internet connection; Microsoft Mouse, Microsoft IntelliMouse, or compatible pointing device. Click the Download button on this page to start the download. Internet explorer latest for windows 7. Windows 7 Service Pack 1, Windows Server 2008 R2 SP1. Computer/ Processor: Computer with a 233MHz processor or higher (Pentium processor recommended) Memory: 512MB. Hard Drive Space:70MB. Display: Super VGA.

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:


On my XP machine, the command is unrecognized.

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

9 Answers

Seagate Hard Drive Serial Number Lookup

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.


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.

Arduino uno starter kit manual. Aug 12, 2015  Topic: PDF of book that comes with the Arduino starter kit (Read 199408 times) previous topic - next topic. Ambi Guest; PDF of book that comes with the Arduino starter kit. Oct 09, 2013, 10:30 pm. Hi, Our University has purchased 60 starter kits and I have just started using it in classroom to teach programming. The book that comes with the kit.

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.

25.5k5 gold badges25 silver badges31 bronze badges

You can use


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.

Veeren SharmaVeeren Sharma

Hitachi Hard Drive Serial Number Location

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

Fery WardiyantoFery Wardiyanto

Micron Hard Drive Serial Number Location

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