Save all Windows processes to a text file - gHacks Tech News

Save all Windows processes to a text file

It can sometimes be useful to dump the list of all running processes on a Windows machine. While you can use the Task Manager or third-party applications like Process Explorer or TaskSchedulerView to list all running tasks and manage them directly from within the interface.

Third-party apps like Process Explorer support the exporting of all processes to text files on the system but the standard Task Manager of the Windows operating system does not.

Windows includes the command line tool tasklist that is designed to display the list of tasks and filter the listing. While it does not support built-in export options, it does support the option to direct command line output elsewhere.

Tasklist, just like taskkill which we published a guide about earlier, is a handy command line tool that all supported versions of Windows support.

The Tasklist tool

tasklist

You can run tasklist from the command line and don't need elevated rights for that. Just tap on Start, type cmd.exe and open the Command Prompt from the results to get started.

Simply typing tasklist and hitting the Enter-key displays a list of all running processes on the system. Each process is listed with its name, process ID, session name and number, and memory usage.

You can save the process listing right away by running the command tasklist > output directory and file name, e.g. tasklist > d:\processes.txt.

tasklist output

The utility supports three different display formats. Table is used by default but you may use the command /fo to switch to list or csv view instead. Just use tasklist /fo csv to display the list of processes in a comma separated format instead.

Tasklist shines when it comes to supported filters. You can use filters to display information that you need from information that you don't need. Filters exist to display processes by memory usage, CPU time, process ID, window title, or username among others.

Filters support operators such as eq=equal, ne=not equal, or gt=greater. Note that the filters WINDOWTITLE and STATUS are not supported when you run tasklist on a remote system.

Here is a list of examples that demonstrate filter usage:

  • tasklist /fi "USERNAME eq Martin" -- returns the list of processes run under the user Martin.
  • tasklist /fi "USERNAME ne NT AUTHORITY\SYSTEM" /fi "STATUS eq running" -- returns all processes that are running under system processes.
  • tasklist /fi "MODULES eq nt*" -- Lists all processes that have a DLL that begins with nt.
  • tasklist /fi "PID gt 2000" -- displays all processes with an ID greater than 2000.
  • tasklist /fi "MEMUSAGE gt 4096" -- lists all processes whose memory usage is greater than 4096 Kilobytes.

You can combine filters with other parameters:

  • tasklist /s BasementComp /svc /fi "MEMUSAGE gt 4096" -- Lists processes on the remote computer BasementComp that use more than 4 Megabytes of RAM.
  • tasklist /s BasementComp /u maindom\joe /p password -- to list processes on the remote computer BasementComp using the user joe and joe's password.

You can save all outputs to a text file using the > destination command.

Additional information is provided when you run tasklist /? and on Microsoft's Docs website.

Now You: Which command line tools do you use?

Summary
Save all Windows processes to a text file
Article Name
Save all Windows processes to a text file
Description
The guide provides you with information about the Windows command line tool tasklist and explains how to use it to save all processes to a text file.
Author
Publisher
Ghacks Technology News
Logo

We need your help

Advertising revenue is falling fast across the Internet, and independently-run sites like Ghacks are hit hardest by it. The advertising model in its current form is coming to an end, and we have to find other ways to continue operating this site.

We are committed to keeping our content free and independent, which means no paywalls, no sponsored posts, no annoying ad formats or subscription fees.

If you like our content, and would like to help, please consider making a contribution:

Comments

  1. Paul(us) said on July 6, 2018 at 12:44 pm
    Reply

    The free, awards winning software for exploration & management of System Internals system explorer version 7.1.05359, which is still working like a charm in the latest Windows 10 version 1803 17134.137, has an included future that there is the possibility to make also all kind of running programs lists.

    By the way hopefully, the developer will pick up (2016-04-30) this really great program.

    p.s. I know about the Mark Russinovich program Process Explorer but personly I prefer System explorer.

    1. Shiva said on July 7, 2018 at 11:22 am
      Reply

      I use it too (portable 7.0.05356 on win 7) and I corfirm that is a very useful software. You can export as .txt or .cvs all the column you choose in process window. But you can export as well modules, drivers, services and other informations.

  2. Franck said on July 6, 2018 at 1:15 pm
    Reply

    Very useful, thank you !

  3. John Fenderson said on July 6, 2018 at 6:32 pm
    Reply

    This is incredibly useful. I wish I had known how to do this years ago!

  4. Niko, Poland said on July 6, 2018 at 7:46 pm
    Reply

    Hello. You can overwrite the file.

    tasklist >> d:\processes.txt

  5. Matt said on July 6, 2018 at 8:36 pm
    Reply

    If you prefer, you can open the task list in Notepad instead:

    tasklist /fo table | clip && notepad

    -Press Ctrl+V, then choose to save or not…

    Or, manipulate the data in Excel instead: (using Excel 2007 right now)

    tasklist /fo table | clip && start excel

    -When it opens, click “Paste” or Ctrl+V
    -Move to “Data” tab, then click “Text-To_Columns”
    -Highlight table heading, then click “Filter”
    -Sort or manipulate the table further as you like

    I like to also…
    -Delete row “3” and column “F”
    -Select columns “A” through “E”, then add “Conditional Formatting”-“Data Bars” from the “Home” tab.
    -Sort by Mem Usage, etc.

  6. Elias Fotinis said on July 6, 2018 at 11:40 pm
    Reply

    You can do the same and much more with PowerShell. Its commands (or “cmdlets”) return actual objects instead of text, so filtering, sorting, formatting, etc. are way easier. For example, this command pipeline:

    ps firefox | where WorkingSet -ge 200mb | select id,handles | ConvertTo-Csv > myfile.csv

    will first generate info of all Firefox processes, then keep only those with a working memory set of 200MB or greater, then select the process ID and number of open handles of each process (among some 80 available properties), then format the result as CSV and finally write the output to a file!

    The PowerShell console also supports Tab autocompletion of paths, commands, switches and even option values, so typing even long commands can be lightning fast. Combine that with extensive help and high discoverability and you’ll see why I haven’t opened a CMD prompt in years. :)

Leave a Reply

Check the box to consent to your data being stored in line with the guidelines set out in our privacy policy

Please note that your comment may not appear immediately after you post it.