Fair warning: the way presented here is not really an ‘easy’ solution.
WMIC
is a command that accesses WMI, Windows Management Instrumentation. WMIC CPU GET /FORMAT:LIST
presumably gets the CPUs; on the level of WMI itself, you’re probably just trying to get all instances of Win32_Processor
.
WMI can be accessed through COM. To do so, you’d start by using CoCreateInstance
to create an IWbemLocator
, then calling ConnectServer
to get an IWbemServices
, on which you could run ExecQuery
to query for Win32_Processor
s.
Unfortunately, COM is not very easy to access from C, but it is doable. (Unfortunately I could not find any page on MSDN about it; that CodeProject article is the best I could find.)
I’m not particularly familiar with any of these technologies in great depth, but if you research them all, that’s how you’d connect them together to get that information natively rather than by calling out to an external command.