Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Beyond TASKLIST

Aug
1,929
71
The TCC TASKLIST command provides a list of active processes, but I have a need to put this information into a spreadsheet.

The TASKLIST.EXE program, included with the Windows OS, has an option to display the output format as CSV, which can be sent to the Windows Clipboard, and pasted into a spreadsheet.

To obtain this same information, and more, use the PowerShell Get-Process Cmdlet. The following example does what I require;

Code:
get-process | convertto-csv -delimiter "`t" -notypeinformation | clip

I then switch to my spreadsheet, and paste in the information.

If you don't like the name get-process, you can create a Powershell alias;

Code:
set-alias tasklist get-process

To run this PowerShell command from CMD.EXE;

Code:
powershell -command "& {get-process | convertto-csv -delimiter "`t" -notypeinformation}" | clip

To run this PowerShell command from TCC involves a little bit more;

Code:
SetLocal
setdos /X-57
powershell -command "& {get-process | convertto-csv -delimiter "`t" -notypeinformation}" | clip
EndLocal

If you just want information on one process, for example, tcc;

Code:
get-process tcc | convertto-csv -delimiter "`t" -notypeinformation | clip

If you just want specific properties on one process, for example, tcc;

Code:
get-process tcc | select-object name, fileversion, productversion, company | convertto-csv -delimiter "`t" -notypeinformation | clip

Again, I am sending the output of this command to the clipboard, so that I can paste it into a spreadsheet. If you just want to display the results on the display, eliminate the | clip

Joe
 
Joe,

If the tasklist.exe application does what you need, why do you need to launch PowerShell?

Code:
tasklist.exe /v /fo csv > clip:

-Scott
 
Joe,

If the tasklist.exe application does what you need, why do you need to launch PowerShell?

Code:
tasklist.exe /v /fo csv > clip:

-Scott

Get-Process allows me to select the fields that I want, and arrange them in the order I want, eliminating my need to do so in the spreadsheet.

Joe
 
Back
Top