Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find Number of CPUs and Cores per CPU using Command Prompt

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?

like image 414
Mustafa Avatar asked Apr 07 '14 17:04

Mustafa


People also ask

How do I check number of CPU cores?

Press Ctrl + Shift + Esc to open Task Manager. Select the Performance tab to see how many cores and logical processors your PC has.

How many CPUs do I have command line?

You can use one of the following command to find the number of physical CPU cores including all cores on Linux: lscpu command. cat /proc/cpuinfo. top or htop command.

What is the command to get CPU details?

Use the cat command to display the data held in /proc/cpuinfo. This command will produce a lot of text, typically it will repeat the same information for the number of cores present in your CPU. A more concise means to get most of this information is via lscpu, a command that lists the CPU details. 1.

How many cores do I have PowerShell?

Open PowerShell or Command Prompt and enter this command: wmic cpu get NumberOfCores,NumberOfLogicalProcessors. Make sure that there is no space between NumberOfCores and NumberOfLogicalProcessors. The output of the command tells you how many cores and how many logical processors are found on your CPU.


1 Answers

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

echo %NUMBER_OF_PROCESSORS% 
like image 77
R1tschY Avatar answered Oct 19 '22 17:10

R1tschY