Results 1 to 10 of 10

Thread: Hdd Serial...

  1. #1

    Thread Starter
    ^:^...ANGEL...^:^ wrack's Avatar
    Join Date
    Mar 2002
    Location
    Melbourne, AUSTRALIA
    Posts
    2,695

    Question Hdd Serial...

    Need a VB Code for finding Hard Disk Serial No.

    Just curious that, can we change this number or it's fixed or when does is changes.

    Thanks in advance...

  2. #2
    Frenzied Member ae_jester's Avatar
    Join Date
    Jun 2001
    Location
    Kitchener Ontario Canada Earth
    Posts
    1,545
    cant change that its fixed.......but it changes if the hard drive is formatted just so you know

    check out this post

    http://www.vbforums.com/showthread.p...=serial+number

  3. #3

    Thread Starter
    ^:^...ANGEL...^:^ wrack's Avatar
    Join Date
    Mar 2002
    Location
    Melbourne, AUSTRALIA
    Posts
    2,695

    Exclamation Need this fast...

    .....

  4. #4

    Thread Starter
    ^:^...ANGEL...^:^ wrack's Avatar
    Join Date
    Mar 2002
    Location
    Melbourne, AUSTRALIA
    Posts
    2,695

    Thumbs up OK...

    Thanks for that but I need to find the serial number...

  5. #5
    Hyperactive Member
    Join Date
    Jun 2000
    Posts
    350
    As we've discussed before, it's not strictly a serial number since it changes on formatting. Serial numbers in the strict sense, are allocated serially by say a manufacturer, for various purposes. Eg the VIN on your car identifies it in case of theft, or on your microwave would indicate the date of manufacture for warranty purposes.

    A serial number which changes is bloody stupid. Some software makers generate a licence string based on the hdd serial number, so if you re-format your drive you have to go through the whole rigmarole of getting a new licence.
    .

  6. #6

    Thread Starter
    ^:^...ANGEL...^:^ wrack's Avatar
    Join Date
    Mar 2002
    Location
    Melbourne, AUSTRALIA
    Posts
    2,695

    Talking any other way...

    TA JIM,

    Need the exact thing, every time you format the HDD need new SERIAL.

    Also can u or some else can send me a VB CODE for finding out MOTHER BOARD's SERIAL NO.

  7. #7
    Fanatic Member daydee's Avatar
    Join Date
    Jun 2001
    Location
    Canada
    Posts
    560
    Not sure about the mother board serial number but here's a simple way to get HDD SN using GetVolumeInformation API.
    All u'll need is a commandButton and a textBox for this one.
    Compile to exe and move it around different drives to get the drive's S N.
    Hope it helps...

    VB Code:
    1. Option Explicit
    2. Private Declare Function GetVolumeInformation Lib "kernel32" Alias _
    3.                     "GetVolumeInformationA" _
    4.                     (ByVal lpRootPathName As String, _
    5.                     ByVal lpVolumeNameBuffer As String, _
    6.                     ByVal nVolumeNameSize As Long, _
    7.                     lpVolumeSerialNumber As Long, _
    8.                     lpMaximumComponentLength As Long, _
    9.                     lpFileSystemFlags As Long, _
    10.                     ByVal lpFileSystemNameBuffer As String, _
    11.                     ByVal nFileSystemNameSize As Long) As Long
    12. Private Sub Command1_Click()
    13. Dim Serial As Long
    14.     Dim VName As String, drvlettr As String, FSName As String
    15.     Dim lFs As Long
    16.     VName = String$(255, Chr$(0))
    17.     FSName = String$(255, Chr$(0))
    18.     On Error GoTo ErrorHandler
    19.     drvlettr = Left$(App.Path, 3)
    20.     'Get serial # from GetVolumeInformation API
    21.     GetVolumeInformation drvlettr, VName, 255, Serial, 0, lFs, FSName, 255
    22.     Text1.Text = "The serial number of " & drvlettr & " is '" & Trim(Str$(Serial)) & "'"
    23. Exit Sub
    24. ErrorHandler:
    25.     MsgBox "Error " & Err.Number & " (" & Err.Description & ")"
    26.  
    27. End Sub

  8. #8
    PowerPoster
    Join Date
    Feb 2001
    Location
    Crossroads
    Posts
    3,046
    Originally posted by daydee
    Not sure about the mother board serial number but here's a simple way to get HDD SN using GetVolumeInformation API.
    All u'll need is a commandButton and a textBox for this one.
    Compile to exe and move it around different drives to get the drive's S N.
    Hope it helps...

    VB Code:
    1. Option Explicit
    2. Private Declare Function GetVolumeInformation Lib "kernel32" Alias _
    3.                     "GetVolumeInformationA" _
    4.                     (ByVal lpRootPathName As String, _
    5.                     ByVal lpVolumeNameBuffer As String, _
    6.                     ByVal nVolumeNameSize As Long, _
    7.                     lpVolumeSerialNumber As Long, _
    8.                     lpMaximumComponentLength As Long, _
    9.                     lpFileSystemFlags As Long, _
    10.                     ByVal lpFileSystemNameBuffer As String, _
    11.                     ByVal nFileSystemNameSize As Long) As Long
    12. Private Sub Command1_Click()
    13. Dim Serial As Long
    14.     Dim VName As String, drvlettr As String, FSName As String
    15.     Dim lFs As Long
    16.     VName = String$(255, Chr$(0))
    17.     FSName = String$(255, Chr$(0))
    18.     On Error GoTo ErrorHandler
    19.     drvlettr = Left$(App.Path, 3)
    20.     'Get serial # from GetVolumeInformation API
    21.     GetVolumeInformation drvlettr, VName, 255, Serial, 0, lFs, FSName, 255
    22.     Text1.Text = "The serial number of " & drvlettr & " is '" & Trim(Str$(Serial)) & "'"
    23. Exit Sub
    24. ErrorHandler:
    25.     MsgBox "Error " & Err.Number & " (" & Err.Description & ")"
    26.  
    27. End Sub
    Why does the VOL command in DOS give a different HDD serial number than the one given by the API above?

  9. #9
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    Originally posted by wrack
    Also can u or some else can send me a VB CODE for finding out MOTHER BOARD's SERIAL NO.
    Get MotherBoard Serial Number

  10. #10
    New Member
    Join Date
    Aug 2008
    Posts
    1

    Re: Hdd Serial...

    hello all,

    i am use this code. but i get hard disk serial no not drive no.
    this code use give a drive serial no. if u format then change serial no. but i want hard disk serial no this no not change after formating

    so plz help me.
    thx in advace

    regards,
    piyush

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width