How to change Hard Disk's Volume Serial Number (Volume ID) Last updated on March 3rd, 2016. The Volume Serial Number (also known as VSN) is a unique serial number that is assigned to an optical disk (CD or DVD) or a hard drive after formatting.
- Re: Retrieve Serial number of hard disk and mother board? « Reply #7 on: November 12, 2012, 09:29:28 am » This code worked for me to get the volume IDs of the drives/partitions on Windows.
- Re: Get Hard Disk Serial Number Delphi XE3: News Group: embarcadero.public.delphi.deployment Hi my friend, this provides the unchangeable manufacturer's serial number. You are referring to the soft hard disk serial number that can be changed with an editor.
I want to get hard disk serial number. How I can I do that?I tried with two code but I am not getting
In this one I am not getting any Unique Serial number.
And Second one is
Here I am getting VolumeSerialNumber
. But it is not unique one. If I format the hard disk, this will change. How Can I get this?
10 Answers
Hm, looking at your first set of code, I think you have retrieved (maybe?) the hard drive model. The serial # comes from Win32_PhysicalMedia
.
Get Hard Drive model
Get the Serial Number
Hope this helps :)
hims056I have used the following method in a project and it's working successfully.
you can call the above method as mentioned below,
If you need a unique identifier, use a combination of these IDs.
SencySencyUse 'vol' shell command and parse serial from it's output, like this.Works at least in Win7
The best way I found is, download a dll from here
Then, add the dll to your project.
Then, add code:
Then, call the hard disk ID from where you need it
Note: go to properties of the dll in explorer and set 'Build action' to 'Embedded Resource'
Brian WebsterBelow a fully functional method to get hard disk serial number:
Here is a solution using win32 api and std string in case you need your application to run on a OS with no CLR. I found it here on github.
Hard Disk Serial Number Delphi Number
Get Hard Drive Serial Number
In case you want to use it for copy protection and you need it to return always the same serial on one computer (of course as far as first hdd or ssd is not changed) I would recommend code below. For ManagementClass you need to add reference to System.Management. P.S. Without 'InterfaceType' and 'DeviceID' check that method can return serial of random disk or serial of USB flash drive which connected to pc right now.