4

What tool should I be using so that I can easily print a list with all the processes that are currently running in Windows?

Or maybe there are some commands I could use. Any suggestions?

2
  • By print you mean actually printing on paper?
    – nixda
    Aug 11, 2013 at 12:57
  • Obviously - yes! Aug 12, 2013 at 16:39

3 Answers 3

6

The tasklist command will output a list of all running processes. You can redirect it to a text file with tasklist > filename.txt and then print that file using Notepad or any other program that handles text files.

2
  • Both are good answers, however the result of this command looks better than the other one, so I will mark this is the best answer. Thank you very much! Aug 12, 2013 at 16:43
  • Ahh yes, Powershell ... Powershell is the wave of the future. Like most Powershell commands I think you can add format flags to modify the output format (even output it to HTML if you want if I'm not mistaken).
    – LawrenceC
    Aug 12, 2013 at 17:24
9

In PowerShell you could use: get-process or get-wmiobject WIN32_PROCESS.

Ok, but can PowerShell show more details? More than CMD tasklist?

  • get-process | format-table -property * -autosize
  • gps | ft * -auto (same command, but shorter version)
  • get-wmiobject WIN32_PROCESS | format-table -property * -autosize
  • gwmi WIN32_PROCESS | ft * -auto (same command, but shorter version)

Uh, thats too much detail. Can I select the columns I need?

  • gps | ft name,ID,sessionID,basepriority,priorityClass,path -auto
  • gwmi WIN32_PROCESS | ft name,processID,priority,CommandLine -auto

Ah, better. But some columns are truncated. I can avoid this by saving to file, right?

  • gps | ft * -auto | Out-File D:\process-list.txt -Width 4096
  • gwmi WIN32_PROCESS | ft * -auto | Out-File D:\process-list.txt -Width 4096

Wonderful. What about printing it directly?

  • gps | ft * -auto | Out-Printer
  • gwmi WIN32_PROCESS | ft * -auto | Out-Printer

Can I also export them as CSV ?

  • gps | select * | Export-Csv D:\process-list.csv
  • gwmi WIN32_PROCESS | select * | Export-Csv D:\process-list.csv

Oh thats cool. Can I sort the output by memory or CPU usage?

gwmi WIN32_PROCESS | Sort ws -desc | ft name, @{Name="Mem Usage (KB)";Expression={[math]::round($_.ws / 1kb)}} -auto
gwmi Win32_PerfFormattedData_PerfProc_Process | sort PercentProcessorTime -desc| ft name, PercentProcessorTime -auto

All commands are fully explained on SS64.com together with some examples and available aliases.

1
  • Thanks for all the help. I summarized the basics in a step-by-step tutorial, complete with screenshots and references to useful documentation, here: 7tutorials.com/… Aug 13, 2013 at 11:13
0

powerShell

Get-Process | Out-File d:\processes.txt

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .