How to get mother board's and hard disc's Serial Number

Is there any API function that retrieves serial number of mother board or hard disc.

Answer this question

How to get mother board's and hard disc's Serial Number

  • beyonddc

    That's certainly helpful, Sahir. Thanks!
  • Gallo_Teo

    If it's of any help, you can use

    BOOL GetVolumeInformation(
      LPCTSTR lpRootPathName,           // root directory
      LPTSTR lpVolumeNameBuffer,        // volume name buffer
      DWORD nVolumeNameSize,            // length of name buffer
      LPDWORD lpVolumeSerialNumber,     // volume serial number
      LPDWORD lpMaximumComponentLength, // maximum file name length
      LPDWORD lpFileSystemFlags,        // file system options
      LPTSTR lpFileSystemNameBuffer,    // file system name buffer
      DWORD nFileSystemNameSize         // length of file system name buffer
    );

    To get the volume serial number.

    However, please note that the volume serial number will change if the drive is formatted.


  • Gaspar Nagy

    This forum is for general IDE issues for VC programming.

    That said, I don't think there's a Win32 API for that kind of thing. This is an OEM- specific question.

    Try starting with the hardware manufacturer tech support (their diagnostic tools often make such queries, but it's usually in assembly language). Yon can also search the web.

    Brian


  • How to get mother board's and hard disc's Serial Number