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. Retrieving Machine ID

Retrieving Machine ID

Scheduled Pinned Locked Moved C / C++ / MFC
c++help
4 Posts 4 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.
  • S Offline
    S Offline
    SachinBhave
    wrote on last edited by
    #1

    Hi All, I have a requirement, where I need to get the following information. 1. MAC Address. 2. HDD Serial Number 3. CD/DVD Drive Serial Number. 4. CPU Processor ID. I have my application in VC++ using MFC. Any help will be highly appreciated. Thanks, Sachin.

    _ V 2 Replies Last reply
    0
    • S SachinBhave

      Hi All, I have a requirement, where I need to get the following information. 1. MAC Address. 2. HDD Serial Number 3. CD/DVD Drive Serial Number. 4. CPU Processor ID. I have my application in VC++ using MFC. Any help will be highly appreciated. Thanks, Sachin.

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

      GetVolumeInformation() will do more than half the work. For MAC Address - (this is only my opinion) one thing that would work all the time is run a shell "arp -a" and internally search the output for the needed MAC. The other thing you can do is WMI(Read it somewhere don't know how it's done) Somethings seem HARD to do, until we know how to do them. ;-) _AnShUmAn_

      D 1 Reply Last reply
      0
      • S SachinBhave

        Hi All, I have a requirement, where I need to get the following information. 1. MAC Address. 2. HDD Serial Number 3. CD/DVD Drive Serial Number. 4. CPU Processor ID. I have my application in VC++ using MFC. Any help will be highly appreciated. Thanks, Sachin.

        V Offline
        V Offline
        Viorel
        wrote on last edited by
        #3

        Perhaps you will found methods based on querying the System Registry. Nevertheless, consider that the data you need can be obtained using Windows Management Instrumentation (WMI):

        • MAC Address -- see Win32_NetworkAdapter WMI class;
        • HDD Serial Number -- see Win32_DiskDrive WMI class;
        • CD/DVD Drive Serial Number -- see Win32_CDROMDrive WMI class;
        • CPU Processor ID -- see Win32_Processor WMI class.

        WMI seems to be difficult to use in C++. So use it if no easier equivalent methods.

        1 Reply Last reply
        0
        • _ _AnsHUMAN_

          GetVolumeInformation() will do more than half the work. For MAC Address - (this is only my opinion) one thing that would work all the time is run a shell "arp -a" and internally search the output for the needed MAC. The other thing you can do is WMI(Read it somewhere don't know how it's done) Somethings seem HARD to do, until we know how to do them. ;-) _AnShUmAn_

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          _AnShUmAn_ wrote:

          GetVolumeInformation() will do more than half the work.

          How so? While it may be used to get the serial number of the hard drive or the CD drive, how do you propose it getting the MAC address or the CPU id?

          _AnShUmAn_ wrote:

          For MAC Address - (this is only my opinion) one thing that would work all the time is run a shell "arp -a" and internally search the output for the needed MAC.

          Even though APIs exist for obtaining MAC addresses, capturing the output or arp -a is not going to work. You should use ipconfig /all instead.


          "The largest fire starts but with the smallest spark." - David Crow

          "Judge not by the eye but by the heart." - Native American Proverb

          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