Hard Disk Serial Number 
Author Message
 Hard Disk Serial Number

Hi Chris,

It ain't easy.  The most straightforward way I know of is to use the
DiskInfo custom control available from Mabry software
( http://www.***.com/ , I believe), which makes this information (along with
some other useful items) available.  My understanding is that getting this
information requires an absolute disk read, of which I am told VB is
inherently incapable.

-- C. Luc Reid
   Owner, Reid Software Development

    http://www.***.com/
   Haddonfield, NJ



Quote:
> Can anyone tell me how to get the Hard Disk serial number in VB





Mon, 18 Oct 1999 03:00:00 GMT
 Hard Disk Serial Number



Quote:
> Can anyone tell me how to get the Hard Disk serial number in VB



This works Ok in Vb4 32 bit

Option Explicit

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 ReadSN()

   Dim RootPathName As String
   Dim VolumeNameBuffer As String
   Dim VolumeNameSize As Long
   Dim VolumeSerialNumber As Long
   Dim MaximumComponentLength As Long
   Dim FileSystemFlags As Long
   Dim FileSystemNameBuffer As String
   Dim FileSystemNameSize As Long

   Dim ApiRtn as Long

   RootPathName$ = "C:\"

   VolumeNameBuffer = Space$(255)
   VolumeNameSize = 255
   FileSystemNameBuffer = Space$(255)
   FileSystemNameSize = 255

   ApiRtn = GetVolumeInformation(RootPathName, _
    VolumeNameBuffer, VolumeNameSize, VolumeSerialNumber, _
    MaximumComponentLength, FileSystemFlags, _
    FileSystemNameBuffer, FileSystemNameSize)

   ' Serial Number is contained in VolumeSerialNumber

   ' Sometimes Serial Number may be less than zero!

End Sub

Fabio Pagano - Bari - Italy



Tue, 19 Oct 1999 03:00:00 GMT
 Hard Disk Serial Number

Can anybody tells where I can get the serial number if I use an absolute
disk read (using C)?

Jean Claude


...

Quote:
>Hi Chris,

>It ain't easy.  The most straightforward way I know of is to use the
>DiskInfo custom control available from Mabry software
>(http://www.mabry.com, I believe), which makes this information (along
with
>some other useful items) available.  My understanding is that getting
this
>information requires an absolute disk read, of which I am told VB is
>inherently incapable.

>-- C. Luc Reid
>   Owner, Reid Software Development

>   http://www.ariasoft.com/
>   Haddonfield, NJ



>> Can anyone tell me how to get the Hard Disk serial number in VB





Mon, 25 Oct 1999 03:00:00 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. Obtaining Hard Disk Serial Number

2. Hard disk serial number or Ethernet card serial number.

3. API for the hard disk label and serial number

4. Volume serial number of a hard disk

5. MACINTOSH - Foxpro routine to grab hard disk serial #

6. Hard disk serial no.

7. Disk Drive Serial Number?

8. FPW26: Getting a disk's serial number

9. Disk Drive Serial Number

10. How do I read the disk Serial Number

11. DISK SERIAL NUMBER

12. Disk Array v/s hard Disk


 
Powered by phpBB® Forum Software