How to get hardware information in Windows using C++?

M.Rezaei picture M.Rezaei · Nov 23, 2010 · Viewed 13.5k times · Source

How to get hardware information (for example cpuId, biosId, diskId, baseId and videoId) in c++?

Can anyone give me an example visual studio project for this?

Answer

ur. picture ur. · Nov 23, 2010

There are very different ways to get a disk id (serial number? volume id?) or a CPU ID or ... . I think you want to build a fingerprint of the computer. The most comfortable way is to use Windows Management Instrumentation (WMI) and access the DMI . See MSDN for a start. See MSDN here for a hint how to get the mainboard serial number as an example.