C:\> wmic cpu get loadpercentage
LoadPercentage
0

Or

C:\> @for /f "skip=1" %p in ('wmic cpu get loadpercentage') do @echo %p%
4%
Answer from Alex K. on Stack Overflow
Top answer
1 of 4
20

You can use the tool typeperf.

To list all processes:

typeperf "\Process(*)\% Processor Time" -sc 1

List all processes, take 5 samples at 10 second intervals:

typeperf "\Process(*)\% Processor Time" -si 10 -sc 5

If you want a specific process, node for example:

typeperf "\Process(node)\% Processor Time" -si 10 -sc 5

You also can dump it to a csv file and filter in a spreadsheet to remotely diagnose issues.

The following gives me 5 minutes (at 10 second intervals) of all processes. The data includes not just % Processor Time, but IO, memory, paging, etc.

typeperf -qx "\Process" > config.txt
typeperf -cf config.txt -o perf.csv -f CSV -y -si 10 -sc 60

More info: https://technet.microsoft.com/en-us/library/bb490960.aspx

2 of 4
7

typeperf has two drawbacks:

  1. typeperf with arguments as english names won't work on non-english machines, and
  2. typeperf with arguments as numbers will break because those numbers vary by machine. (Source: https://stackoverflow.com/a/39650695)

To avoid those drawbacks, you can use powershell's Get-WmiObject cmdlet. It uses different names compared to typeperf, but you can get the same information, as far as I can tell.

I think that running these commands in powershell will give you what you want:

echo 'Map of process ID to command line:'
Get-WmiObject -Query "Select * from Win32_Process" | Select-Object -Property ProcessId,ExecutablePath,CommandLine | ConvertTo-Csv -NoTypeInformation
echo 'Map of process ID to memory usage:'
Get-WmiObject -Query "Select * from Win32_PerfFormattedData_PerfProc_Process" | Select-Object -Property IDProcess,Name,PageFileBytes,PoolNonpagedBytes,PoolPagedBytes,PrivateBytes,VirtualBytes,WorkingSet | ConvertTo-Csv -NoTypeInformation
echo 'Map of process ID to CPU usage:'
Get-WmiObject -Query "Select * from Win32_PerfFormattedData_PerfProc_Process" | Select-Object -Property IDProcess,Name,PercentProcessorTime | ConvertTo-Csv -NoTypeInformation
echo 'Many people want to do some massaging of the "PercentProcessorTime" numbers above,'
echo 'because in their raw form those numbers (for a single process) can be over 100 percent.'
echo 'So divide all of the "PercentProcessorTime" numbers by this number:'
Get-WmiObject -Query "Select * from Win32_ComputerSystem" | Select-Object -Property NumberOfLogicalProcessors | ConvertTo-Csv -NoTypeInformation
Discussions

Command-line tool for Windows that reports CPU and Memory utilization per process?
Native: TASKLIST /V SysInternals: PSLIST /M PSLIST /X Then there's Powershell... More on reddit.com
🌐 r/sysadmin
7
1
September 8, 2022
High CPU Usage in Windows Command Processor
I have Windows Command Processor (32 bit) CPU high usage trouble in my pc More on answers.microsoft.com
🌐 answers.microsoft.com
6
171
High CPU Usage in Windows Command Processor
I have Windows Command Processor (32 bit) CPU high usage trouble in my pc More on learn.microsoft.com
🌐 learn.microsoft.com
6
171
May 10, 2020
Get a list of processes and their CPU usage %

Use get-counter, you need to catch values at start and end and do calculations on cooked value. Powershell isn't at fault, it is simply reading the OS counter values. On phone, can't type sample. Search for examples online and adapt something to your needs.

More on reddit.com
🌐 r/PowerShell
6
4
April 9, 2021
Top answer
1 of 2
1

Personally I would use Python and the lovely psutil library which can gather just about all of the information that you can dream of:

For a process on Windows you can get:

  • cpu_percent
  • cpu_times
  • io_counters
  • memory_info
  • memory_maps
  • num_ctx_switches
  • num_handles
  • num_threads
  • username
  • full exe path
  • cmdline
  • parent
  • status
  • cwd
  • io_counters
  • much more
  • even more on Linux & OSX

Some Python 3.5+ code to do more or less what you are asking for to the console, (the same can be done with earlier Pythons but not with the f-string):

import psutil
import time
import datetime

while True:
    print(datetime.datetime.now())
    for proc in psutil.process_iter():
        try:
            pr = proc.as_dict()
            print(f'{pr["name"]}\t{pr["memory_percent"]}\t{pr["cpu_percent"]}\t{pr["num_threads"]}\t{" ".join(pr["cmdline"][1:]) if pr["cmdline"] else ""}')
        except (OSError, psutil.AccessDenied):
            print(pr.name(), 'ACCESS DENIED')
    print('\n*** Ctrl-C to Exit ***\n\n')
    time.sleep(600) # Sleep for 10 Mins

On my machine the output looks like:

You could simply pipe the output to a file or you could modify the code to output to a .csv file directly.

  • Free, Gratis & Open Source
  • Cross Platform
  • Flexible
2 of 2
1

You could do this simply with a batch file, here's something I quickly wrote up,

@echo off
ECHO ***Date and Time***
set datetimef=%date:~-4%_%date:~3,2%_%date:~0,2%__%time:~0,2%_%time:~3,2%_%time:~6,2%
echo %datetimef%
ECHO ***List Processes***
WMIC path win32_process get Caption,Processid,Commandline
ECHO ***CPU-Usage***
wmic cpu get loadpercentage
ECHO ***Memory Usage***
systeminfo | findstr Memory

It's pretty simple, you can tweak it to fit your needs but this meets your requirements. I also see that you want this data exported to a file so you can, output the contents of the batch file like this, batch.bat > Logs-%date:~10,4%%date:~7,2%%date:~4,2%_%time:~0,2%%time:~3,2%.log

🌐
Winaero
winaero.com › home › windows 10 › get cpu information via command prompt in windows 10
Get CPU Information via Command Prompt in Windows 10
October 28, 2016 - In the "More details" mode it has a tab "Performance" which shows the CPU name and its clock: Another option is the application "System Information". Use it as follows: Press the Win + R hotkeys together on the keyboard and type the following command in your Run box: ... Tip: See the ultimate list of all Windows keyboard shortcuts with Win keys.
🌐
Reddit
reddit.com › r/sysadmin › command-line tool for windows that reports cpu and memory utilization per process?
r/sysadmin on Reddit: Command-line tool for Windows that reports CPU and Memory utilization per process?
September 8, 2022 -

I've tried a few different powershell scripts as well as a utility called NTop (HTop for Windows). None of them shows the same values as Windows Task Manager. I've tried on Win 10 and 11.

Does anyone know of a command line tool, preferably portable (single exe), that can report resource utilization per process accurately? Including child-processes, etc.

The use case is using our RMM command line tool to view Task Manager data without interrupting the user.

🌐
Wordpress
itworldjd.wordpress.com › 2016 › 05 › 05 › command-line-100-cpu-on-windows
Command line to check 100% CPU on Windows ? – Jacques Dalbera's IT world
May 9, 2016 - Here are tools and methods to get the processes and CPU consumption to detect which process has caused 100% CPU (equivalent to the famous linux command “top”): Using old Windows 2003 resource kit utility – it works also on latest Windows OS: pmon.exe (but pmon.exe does not work through a psexec connection) Other useful command lines: from sysinternals suite: pslist, pskill.
Find elsewhere
🌐
MS.Codes
ms.codes › blogs › computer-hardware › command-to-check-cpu-utilization-in-windows
Command To Check CPU Utilization In Windows
February 14, 2024 - In summary, the commands "tasklist" and "wmic cpu get loadpercentage" can be used to quickly check CPU utilization in Windows, while the Performance Monitor provides more detailed real-time information.
🌐
Oreate AI
oreateai.com › blog › monitoring-process-memory-and-cpu-usage-in-windows-command-line › 472db391d7088e90f2fb5a2226e8dcb7
Monitoring Process Memory and CPU Usage in Windows Command Line - Oreate AI Blog
December 22, 2025 - The 'pslist' command provides an in-depth analysis of a process's memory and CPU utilization, offering information on peak memory usage and average CPU rates to support performance optimization.
🌐
Teckadmin
teckadmin.wordpress.com › 2014 › 05 › 23 › cpu-checks-in-windows-commandline
CPU checks in windows-commandline | Teckadmin
May 23, 2014 - Get CPU usage on server ———————– C:\Windows\system32>typeperf “\Processor(_Total)\% Processor Time” · “(PDH-CSV 4.0)”,”\\vm\Processor(_Total)\% Processor Time” “02/01/2012 14:10:59.361″,”0.648721” “02/01/2012 14:11:00.362″,”2.986384” · Typeperf :-Writes performance counter data to the command window, or to a supported log file format.
🌐
Software OK
softwareok.com
Query CPU usage via the cmd.exe Windows command prompt?
Yes, the CPU load can also be queried via the cmd.exe on all Windows 11, 10, ... OS via the command prompt! How do I get total CPU usage from Windows Command !
🌐
Tech News Today
technewstoday.com › home › windows › how to check cpu usage in windows
How To Check CPU Usage in Windows - Tech News Today
December 5, 2023 - If you’re on Windows Server or simply prefer a CLI approach, you can use different commands to check the CPU usage. To start, press Win + X and select the Terminal. ... You can run this one-liner in a loop to refresh the data every second.
🌐
Super User
superuser.com › questions › 1740980 › get-cpu-usage-of-specific-program-command-line-windows
Get CPU Usage of Specific Program Command Line Windows - Super User
September 6, 2022 - Process explorer can show me the CPU % usage of a particular program: I would like to obtain this number through command line to automatically sample the percentage utilization of a process. It ha...
🌐
GeekChamp
geekchamp.com › home › command to check cpu utilization in windows
Command to Check CPU Utilization in Windows - GeekChamp
December 26, 2025 - The ‘typeperf’ command offers a straightforward way to monitor CPU utilization in real-time from the Windows command line. Its flexibility allows for tailored performance tracking, making it a vital tool in system diagnostics and performance analysis. Monitoring CPU utilization is essential for diagnosing system performance issues and ensuring optimal operation. Windows PowerShell offers robust cmdlets that allow users to efficiently check CPU usage in real-time and generate detailed reports.
🌐
GeeksDigit
geeksdigit.com › command-check-cpu-utilization-windows
Command To Check CPU Utilization In Windows 11/10 - GeeksDigit.Com
3 days ago - The tasklist command is one of ... it provides useful information about processes. Open Command Prompt. Press Windows + R, type cmd, and hit Enter....
🌐
Microsoft Learn
learn.microsoft.com › en-us › previous-versions › windows › desktop › legacy › mt708809(v=vs.85)
How to monitor CPU and network utilization (Windows) | Microsoft Learn
To monitor CPU utilization in real-time, 2 seconds between samples, and stop after 33 samples: Get-Counter -Counter "\Processor(_Total)\% Processor Time" -SampleInterval 2 -MaxSamples 33 ...