Diese Seite mit anderen teilen ...

Informationen zum Thema:
WinDev Forum
Beiträge im Thema:
Erster Beitrag:
vor 4 Jahren, 3 Monaten
Letzter Beitrag:
vor 4 Jahren, 2 Monaten
Beteiligte Autoren:
Vijay Patel, GuenterP, Charles U. Schneiter, Ola, Yogi Yang

how to get Harddisk serial number

Startbeitrag von Vijay Patel am 15.05.2014 06:32

how to get harddisk serial number in winde17


Hi Vijay,

Try this:

EDT_CustomerId = fDriveInfo("C:", fdSerialNumber)
// fdSerialNumber gives the Serial number of the disk, defined when the disk is formatted

Caution: this number differs from the serial number given by the manufacturer.

As we found out in an earlier thread ( http://27130.foren.mysnip.de/read.php?27131,200877,200877#msg-200877 ) that if you clone a harddisk, you will end up with multiple computers having the same harddisk-ID!

Due to lack of standardisation, there is no easy way to get at the manufacturer's unique ID of a given HD. Each manufacturer seems to put this ID at different places in different formats....

So, if you want to use this ID for implementing a licensing scheme, this aint working well..

I changed to a usb-dongle - based system which works very well - also due to the generous help received on this board here :cheers:

von Charles U. Schneiter - am 15.05.2014 07:44
hello,Charles U. Schneiter

that function is generat serial number.. but this is diffrent. drive to diffrent. serial number give.
thai is posible to get unic serial number

von Vijay Patel - am 15.05.2014 08:01
Great! So you want to use your customer's hard disk as your dongle device. Did you plan for the case of a hard disk failure? Or did you plan for hard disk serial# spoofing? See: https://www.raymond.cc/blog/changing-or-spoofing-hard-disk-hardware-serial-number-and-volume-id/

Unfortunately, there's no unique identifier available from the mainboard itself. All other parts of a PC can / will go bad at random time intervals.

The only thing which has a unique serial number indeed and which will not go bad in the foreseeable future is a usb memory stick. Plus, the customer can switch from desktop to laptop without asking you for permission to do so. And if one pc is dead, s/he can easily switch to another pc, at any given time. e.g. Saturay night.

von GuenterP - am 15.05.2014 08:42
Hi again Vijay,

Thats what I wanted to express above.

It is very difficult to get at the manufacturer's unique serial number of the harddisk, since it differs from manufacturer to manufacturer and sometimes even from type to type.

To my best knowledge it is impractical and next to impossible to implement this functionality for a production system which has to reliably work on a wide variety of systems. But others may chime in - I am in no way a hardware expert but parroting from what I have gathered here and else where.

von Charles U. Schneiter - am 15.05.2014 08:46
I think you can try to read HDD Firmware # with help of WMI.

Check the WMI exmple: Complete examples\WD DOTNET WMI.

It may give you some ideas.


Yogi Yang

von Yogi Yang - am 26.05.2014 11:43
Hi, just for the fun of it:


von GuenterP - am 14.06.2014 10:03

I just want to add, that

1. I have empiric experience, that also the motherbord can go bad.
2. Not all USB sticks have a unique serial number. Especially some nano-sized "sticks" can be problematic in this respect; some makes of them all have the same "serial number"! So, before buying a hundred, first buy just two and check their serials.
3. Same as 1: also USB sticks can go bad.

Nothing is sure (except working man's taxes and death):).

best regards

von Ola - am 15.06.2014 21:32
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.