HDD Firmware Serial Number

rahulgty

Registered User.
Local time
Today, 07:49
Joined
Aug 27, 2005
Messages
99
Hi

Is any body know how to retrieve the manufacturer's hard disk serial No.? I want to use it in my access application to avoid piracy. At present I am useing a code which gives me Volume serial No., which got changed when ever my user format his hard drive. Instead of HDD firmware serial, code for retrieval of any other permanent No. like mother board or CPU firmware serial can help me to solve my problem

Rahul
 
rahulgty said:
Hi

Is any body know how to retrieve the manufacturer's hard disk serial No.? I want to use it in my access application to avoid piracy. At present I am useing a code which gives me Volume serial No., which got changed when ever my user format his hard drive. Instead of HDD firmware serial, code for retrieval of any other permanent No. like mother board or CPU firmware serial can help me to solve my problem

Rahul

Yeah, drop this function in a module somewhere in your project...

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

And then do something like the following to utilize it to pull out the serial number of the harddrive.

Private Sub Command46_Click()

Dim strVolumeBuffer As String
Dim strSysName As String
Dim lngSerialNumber As Long
Dim lngSysFlags As Long
Dim lngComponentLen As Long
Dim lngResult As Long

strVolumeBuffer$ = String$(256, 0)
strSysName$ = String$(256, 0)
lngResult = GetVolumeInformation("C:\", strVolumeBuffer$, 255, lngSerialNumber, _
lngComponentLen, lngSysFlags, strSysName$, 255)

MsgBox lngSerialNumber


End Sub
 
Thanks for your reply,

But I have asked about HDD firmware serial No., not the volume no. as your code will retrieve. As the user will format his drive, this no will be changed, while firmaware serial no will not be affected. Any way thanks and I hv been got the code to rertrieve the real HDD s/no. if any body want I can post.
 

Users who are viewing this thread

Back
Top Bottom