List top processes using memory from Windows commandline

This seems to do the trick for listing processes by memory usage. I’m most interested in the top 9 processes (I have to figure out why the regexp isn’t working in findstr for anything over 10 in a range like [1-15].

tasklist /NH | sort /R /+65 | findstr /N . | findstr “^[1-9]:”

Here’s an example output.

C:\Users\rjk>tasklist /NH | sort /R /+65 | findstr /N . | findstr “^[1-9]:” 1:dwm.exe 1640 Console 1 4,232,012 K 2:OUTLOOK.EXE 10600 Console 1 590,128 K 3:explorer.exe 3824 Console 1 342,608 K 4:SearchHost.exe 7016 Console 1 316,300 K 5:chrome.exe 4340 Console 1 279,036 K 6:PhoneExperienceHost.exe 13136 Console 1 231,060 K 7:MsMpEng.exe 12364 Services 0 215,128 K 8:testEmbedNet9401.servUnde 1772 Console 1 205,808 K 9:msedge.exe 26452 Console 1 189,468 K

This goes in line with some other work I’ve done in determining CPU usage using command line (wmic specifically) from the following articles:

Published At
Tagged with