Skip to content

Instantly share code, notes, and snippets.

@bdkosher
Last active August 29, 2015 14:05
Show Gist options
  • Save bdkosher/0fee7f4d16c8fb8311a5 to your computer and use it in GitHub Desktop.
Save bdkosher/0fee7f4d16c8fb8311a5 to your computer and use it in GitHub Desktop.
Shows the total mem usage (in KB) and count of chrome.exe instances (assumes Groovy shell being on PATH)
@tasklist /NH /FI "IMAGENAME eq chrome.exe" | groovy -e "int tm = 0, ci = 0; new BufferedReader(new InputStreamReader(System.in)).text.eachLine { def p = it.split(/\s{2,}/); if (p.length == 4) {tm += (p[-1] - ',' - ' K') as int; ci++} }; println tm + ' (' + ci + ' instances)'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment