Link to home
Start Free TrialLog in
Avatar of mon2000
mon2000

asked on

Hdd Serial Number

How to get the serial number of the HardDisk(Product number not voluem number)
Using c or assembly or any tool available
ASKER CERTIFIED SOLUTION
Avatar of BozzoCage
BozzoCage

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
BozzoCage, posting URLs constructed by using a session ID is useless, somehow ..
useless or not, I'm getting the right files, don't you?

======
Werner
Avatar of BozzoCage
BozzoCage

Isn't that some thread identifier? I would like "better" url too, but how to get it?
Hi, mon2000.

#Questions
1. What exactly do you mean by "product number"?
2. Do you mean the manufacturer?  model number?

#Try This
If you wanted the hard drive's serial number, then the code below should work.

<----------- Sample Code Begins ----------->
' (general-declarations)
Private Declare Function GetVolumeInformation _
    Lib "kernel32" _
    Alias "GetVolumeInformationA" _
    (ByVal lpRootPathName As String, _
    ByVal lpVolumeNameBuffer As String, _
    ByVal nVolumeNameSize As Long, _
    lpVolumeSerialNumber As Long, _
    lpMaximumComponentLength As Long, _
    lpFileSystemFlags As Long, _
    ByVal lpFileSystemNameBuffer As String, _
    ByVal nFileSystemNameSize As Long) As Long


Private Sub Command1_Click()

Dim VolName As String * 255
Dim VolFS As String * 255
Dim Serial As Long
GetVolumeInformation "c:\", VolName, 255, Serial, 0, 0, VolFS, 255

VolName = Left$(VolName, InStr(VolName, Chr(0)) - 1)
VolFS = Left$(VolFS, InStr(VolFS, Chr(0)) - 1)

Debug.Print "Volume Number:", VolName
Debug.Print "File System:", VolFS
Debug.Print "Serial Number:", Hex(Serial)

End Sub
<----------- Sample Code Ends ----------->

#Links
1. "S u r s e (8),"
(subsection: Obtin serial-number-ul pentru HDD)
http://www.geocities.com/SiliconValley/hills/4377/surse8.html

Bye. -e2

No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
 - PAQ'd and pts removed
Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

Nic;o)
BozzoCage's links might not be the best representation, but are still working. They point to nice little programs that will do the job.

======
Werner
Hmm, missed that as I looked to the comment from ahoffmann telling they didn't work...

I guess the moderator will take this in account when finalizing the Q.
I'll change my recommandation to:

- Answered by: BozzoCage


Thanks !

Nic;o)
Is there a small function in Turbo C which can do the
job? The question is simple but not everybody has
technical expertise to write it.  (Atleast not me but will appreciate one.)
Hi pan_kaj,

This is not the place to post a Q :-)
When the answer to your Q isn't found between the comments here I would post my own Q e.g. in the C topic area...

Nic;o)
Finalized as proposed

modulo

Community Support Moderator
Experts Exchange