Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Getting Hard Drive Serial Number

Getting Hard Drive Serial Number

Scheduled Pinned Locked Moved C / C++ / MFC
c++helptutorialquestion
8 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    wasife
    wrote on last edited by
    #1

    Hi, I want to get the manufacturer assigned serial number of hard disk. Please tell me how can i get using C++. I have tried to read the 4 bytes at 27h but it always gives the same number on all the hard disks. Kindly guide me in this regard. Your help will be highly appreciated. Thanks & Regards, Wasif Ehsan. :confused:

    _ N H S 4 Replies Last reply
    0
    • W wasife

      Hi, I want to get the manufacturer assigned serial number of hard disk. Please tell me how can i get using C++. I have tried to read the 4 bytes at 27h but it always gives the same number on all the hard disks. Kindly guide me in this regard. Your help will be highly appreciated. Thanks & Regards, Wasif Ehsan. :confused:

      _ Offline
      _ Offline
      _Superman_
      wrote on last edited by
      #2

      User the WMI class Win32_PhysicalMedia for getting this information.

      « Superman »

      W 1 Reply Last reply
      0
      • _ _Superman_

        User the WMI class Win32_PhysicalMedia for getting this information.

        « Superman »

        W Offline
        W Offline
        wasife
        wrote on last edited by
        #3

        No boss. I need to use simple C++. I can't include advanced features like WMI. Do you have any concept how to get it? Please help me. I am badly in need of it. Regards, Wasif Ehsan. :((

        1 Reply Last reply
        0
        • W wasife

          Hi, I want to get the manufacturer assigned serial number of hard disk. Please tell me how can i get using C++. I have tried to read the 4 bytes at 27h but it always gives the same number on all the hard disks. Kindly guide me in this regard. Your help will be highly appreciated. Thanks & Regards, Wasif Ehsan. :confused:

          N Offline
          N Offline
          Naveen
          wrote on last edited by
          #4

          does GetVolumeInformation() is of any use to u?

          nave

          V 1 Reply Last reply
          0
          • W wasife

            Hi, I want to get the manufacturer assigned serial number of hard disk. Please tell me how can i get using C++. I have tried to read the 4 bytes at 27h but it always gives the same number on all the hard disks. Kindly guide me in this regard. Your help will be highly appreciated. Thanks & Regards, Wasif Ehsan. :confused:

            H Offline
            H Offline
            Hamid Taebi
            wrote on last edited by
            #5

            See here[^]


            WhiteSky


            1 Reply Last reply
            0
            • N Naveen

              does GetVolumeInformation() is of any use to u?

              nave

              V Offline
              V Offline
              vijay_aroli
              wrote on last edited by
              #6

              Naveen R wrote:

              does GetVolumeInformation() is of any use to u?

              i dont think it will help him. it will give the volume serial number that is given by the windows when u format the drive. the volume serial number is not a permanent one. it will change every time u format the drive. the volume serial number can be changed programatically . The Manufacturer's serial number can't be retrieved by GetVolumeInformation(). The manufacturer's serial number and model number is embedded in the Firmware of the disk. it is a permanent one and can't be changed programatically since it is kept in ReadOnly area of the disk. U can use WMI classes or even SMART (Self Monitoring Analysis And Reporting Technology)functions to retrive the serial number. Reading through the IO ports may be another method but its a very unreliable one i suppose. There are plenty of examples that are available on the net but the code is in VB. Use Google and see if u can get some examples in C++. Surely the link given by WhiteSky will help. Good Luck

              vijay.

              1 Reply Last reply
              0
              • W wasife

                Hi, I want to get the manufacturer assigned serial number of hard disk. Please tell me how can i get using C++. I have tried to read the 4 bytes at 27h but it always gives the same number on all the hard disks. Kindly guide me in this regard. Your help will be highly appreciated. Thanks & Regards, Wasif Ehsan. :confused:

                S Offline
                S Offline
                Sam Hobbs
                wrote on last edited by
                #7

                What operating system is this for? If it is not for Windows then it would help to say so.

                V 1 Reply Last reply
                0
                • S Sam Hobbs

                  What operating system is this for? If it is not for Windows then it would help to say so.

                  V Offline
                  V Offline
                  vijay_aroli
                  wrote on last edited by
                  #8

                  Sam Hobbs wrote:

                  If it is not for Windows then it would help to say so.

                  yes, Exactly. :)

                  Regards, vijay.

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups