tags:

views:

217

answers:

2

How to get the unique number (serial number/ID) for Processor (CPU), SCSI, Display, and IDE using C++ program other than WMI and asm code?

A: 

Since you mention WMI, I assume you are working on Windows. Lookup GetVolumeInformation().

Éric Malenfant
this sounds like something for licensing software, GetVolumeInformation() return the volume serial that changes every time the disk is formatted and is trivial change in software. The manufacturer serial would be more helpful.
Stuart
+1  A: 

On Windows you can get CPU info from the environment variable PROCESSOR** , you can parse the volume serial number from vol, the MAC address from route print

If you want to make it cross-platform (and if this is for software licensing) then an open source platform like Linux raises the problem to a whole new level anyway and requires a different approach. However you can still get a lot of the info by parsing the output from standard tools.

You really should consider WMI. In the old days, the BIOS would have been helpful but its all been replaced by the HAL.

CodeProject is always worth searching in cases like this.

How To Get Hardware Information

Stuart