Find Number of CPUs and Cores per CPU using Command Prompt

Mustafa picture Mustafa · Apr 7, 2014 · Viewed 136.6k times · Source

I am trying to retrieve the Number of CPUs and Cores per CPU using Command Prompt. I have executed the following command:

wmic cpu get NumberOfCores, NumberOfLogicalProcessors/Format:List

I get this error: wmic' is not recognized as an internal or external command, operable program or batch file

I am executing this on a Windows Server 2008 R2 machine. I believe the 'wmic' command is compatible on this windows.

The directory I am running the command promt from is 'C:\Windows>

Any advice please?

Answer

R1tschY picture R1tschY · Sep 4, 2015

You can use the environment variable NUMBER_OF_PROCESSORS for the total number of processors:

echo %NUMBER_OF_PROCESSORS%