Thread: how to read hard disk serial number

  1. #1
    Registered User
    Join Date
    Aug 2005
    Posts
    4

    Exclamation how to read hard disk serial number

    sir i want to read the hard disk serail number using c, c++
    can any one help me to read the serial number of hard disk

    or if any one have source code, kindly mail it to me
    regards

  2. #2
    Registered Luser cwr's Avatar
    Join Date
    Jul 2005
    Location
    Sydney, Australia
    Posts
    869
    The C language doesn't know what a hard disk is. Check the documentation specific to your platform/operating system, or post the question to a forum dedicated to the operating system/platform in question.

    As a side note, as far as I know there is no way to read a hard disk serial number. Perhaps you are referring to the Windows volume serial number, which is quite easily changeable, since it's just data that's part of the partition?

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    State your operating system and compiler.
    Also, I'm pretty sure a board search will show something...
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  4. #4
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    a) Please don't cross post.

    b) You can use GetVolumeInformation to obtain the serial number assigned to your volume when it was formatted by your OS, or you can use WMI and the Win32_PhysicalMedia class to get the manufacturers serial ID.

    Use google to find some examples.
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  5. #5
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    Also, check this thread.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 03-04-2005, 02:46 PM
  2. I am lost on how to read from file and output to file?
    By vicvic2477 in forum C++ Programming
    Replies: 4
    Last Post: 02-27-2005, 11:52 AM
  3. Efficient way to read in a randum number of numbers
    By TrojanGekko in forum C++ Programming
    Replies: 0
    Last Post: 03-06-2002, 12:04 AM
  4. Getting the hard drive serial number?
    By kes103 in forum Windows Programming
    Replies: 2
    Last Post: 01-18-2002, 03:03 PM
  5. Getting the hard drive serial number?
    By kes103 in forum C Programming
    Replies: 2
    Last Post: 01-18-2002, 01:43 PM