The Windows task manager has a column labeled Command Line that shows the command that started the given task, with all the switches and parameters, for example:
test.exe -V -A 127.0.0.1 -P 6062
Now I have to identify a certain task that is listening on a certain port and/or was called with a certain switch combination. My aim is to close the selected task, but not others, so if there are multiple test.exe
tasks running, I cannot simply close all tasks returned by:
tasklist /fo csv /nh /fi "imagename eq test.exe"
Unfortunately it seems like neither tasklist
nor pslist
(here) is able to return the Command Line field. How can I overcome this problem?
netstat -aon | grep \.0:6062
for port 6062 and the last column would be the PID of your program. Not sure if that sufficient for you.tasklist /FI "PID eq <PID>"
would give your executable again.process explorer
from Sysinternals can show these in the gui. So the info must be somewhere.