tags:

views:

194

answers:

1

Does anyone know if it's possible to get the full processor name (as shown in Control Panel | System) without using WMI? I'm guessing there's some unmanaged call you can make.

WMI does the job, but I'm finding it intermittently crashes or locks up on some computers.

+3  A: 

You should just be able to check the registry: HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0\ProcessorNameString should give it to you

Here is some example code:

        var key = Registry.LocalMachine.OpenSubKey(@"HARDWARE\DESCRIPTION\System\CentralProcessor\0\");
        var processorName = key.GetValue("ProcessorNameString");
        Console.WriteLine(processorName);
Eric
As far as I can see, this just returns some numbers. Can I get a the full CPU name?
Joe Albahari
This produces "AMD Athlon(tm) 64 X2 Dual Core Processor 4600+" for me.
John Knoeller
Sorry, I edited the answer - I originally suggested the GetSystemInfo win32 call, but that takes some work to parse - the registry way should be easier :)
Eric
This produces "AMD Turion(tm) X2 Dual Core Mobile RM-70" for me.
advs89
Yes - the edited answer is correct. Thanks Eric!
Joe Albahari