listlistviewbatch-filetaskmanagertask-management

Batch that lists currently running APPLICATIONS/WINDOWS not BG processes


I'm making a batch program for launching OS's and utilities, one of these utilities needs to list the currently open applications/windows like task manager but its only apps no BGPROS.

here's a image to show what i need

enter image description here

heres the file

https://drive.google.com/open?id=0Bz92BbPiREo9MHYybTBaNEcyak0

and here's the code so you can find the where it is.

:TASKCHK
cls
:: THIS IS WHERE THE APP LISTER GOES!
echo.
pause
goto UTIL

Solution

  • if you use the /nh parameter after the first command, you can have multiple imagename filters and it lists all the specified processes under one header but it leaves a gap. this is what it would look like:

    tasklist /fi "imagename eq cmd.exe"
    tasklist /nh /fi "imagename eq Taskmgr.exe"
    tasklist /nh /fi "imagename eq chrome.exe"
    tasklist /nh /fi "imagename eq Steam.exe"
    tasklist /nh /fi "imagename eq explorer.exe"
    tasklist /nh /fi "imagename eq wmplayer.exe"
    

    just add another tasklist command to add a new process. And now you can create a batch task manager that, sort of, lists only applications.