
Private Const OUTPUT_DATA_SIZE = IDENTIFY_BUFFER_SIZE + 16 If not, I suspect different hard-disk manufacturers may do it differently. I don't know if there are standards for this or not. If it's stored in some ROM chip on the hard-disk's controller board, then no formatting of any kind should tamper with it. So, I would think that a Windows format may leave the serial number intact, where a low-level format would, almost by necessity, probably overwrite it (but it might try to read it and replace it once reformatted, but that may also depend on the manufacturer and the format utility used).ĮDIT1: Also, it may depend on how the serial number is stored.

This isn't typically done with canned Windows utilities, but typically with a utility from the hard-disk's manufacturer. However, a "true format" will completely ignore everything on a hard-disk, and rebuild all the sectors from scratch. However, I'm not totally familiar with that low-level stuff on NTFS systems. For a FAT system, I could tell you precisely what it does. It just deletes the root directory structure and builds a new/empty one. The call to this dll as below: Declare Function GetHDDSerialId Lib "HardDiskInfoV1.dll" () As Stringĭeclare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Longĭim flNumber As Long = LoadLibrary ("HardDiskInfoV1.And I think it might depend on what you mean by "formatting".Ī "format" from Windows doesn't really do much of anything. Number easily and efficiently, you can use this serial number to createĪn machine id or encrypt number. So HardDriveInfo.DLL helps us to get the Hard disk serial Serial Number, some time it is necessary to get the hard disk serial HardDriveInfo.DLL does not depend on the "support" You can use HardDriveInfo.DLL to read the real serial number


It is an ActiveX COM DLL to read or get hard disk information. Alternatively you can use HardDriveInfo.DLL. MsgBox mydrive.DriveLetter 'displays "C" End SubSee for details. Set mydrive = fso.GetDrive(path) 'Check for success.

Private Sub Command4_Click() Dim fso As New FileSystemObject Dim mydrive As Drive Dim path As String 'Initialize path. Hi, You can use FileSystemObject to get your required info.
