I could not locate list/kill in my copy of Cgywin, too many functions there.
But here is the syntax for Microsoft / PrcView / PsTools List/Kill functions. Again note that only PrcView works on all Windows, others need XP or higher.
=======================
TaskList:
Quote:TASKLIST [/S system [/U username [/P [password]]]]
[/M [module] | /SVC | /V] [/FI filter] [/FO format] [/NH]
Description:
This command line tool displays a list of application(s) and
associated task(s)/process(es) currently running on either a local or
remote system.
Parameter List:
/S system Specifies the remote system to connect to.
/U [domain\]user Specifies the user context under which
the command should execute.
/P [password] Specifies the password for the given
user context. Prompts for input if omitted.
/M [module] Lists all tasks that have DLL modules loaded
in them that match the given pattern name.
If the module name is not specified,
displays all modules loaded by each task.
/SVC Displays services in each process.
/V Specifies that the verbose information
is to be displayed.
/FI filter Displays a set of tasks that match a
given criteria specified by the filter.
/FO format Specifies the output format.
Valid values: "TABLE", "LIST", "CSV".
/NH Specifies that the "Column Header" should
not be displayed in the output.
Valid only for "TABLE" and "CSV" formats.
/? Displays this help/usage.
Filters:
Filter Name Valid Operators Valid Value(s)
----------- --------------- --------------
STATUS eq, ne RUNNING | NOT RESPONDING
IMAGENAME eq, ne Image name
PID eq, ne, gt, lt, ge, le PID value
SESSION eq, ne, gt, lt, ge, le Session number
SESSIONNAME eq, ne Session name
CPUTIME eq, ne, gt, lt, ge, le CPU time in the format
of hh:mm:ss.
hh - hours,
mm - minutes, ss - seconds
MEMUSAGE eq, ne, gt, lt, ge, le Memory usage in KB
USERNAME eq, ne User name in [domain\]user
format
SERVICES eq, ne Service name
WINDOWTITLE eq, ne Window title
MODULES eq, ne DLL name
Examples:
TASKLIST
TASKLIST /M
TASKLIST /V
TASKLIST /SVC
TASKLIST /M wbem*
TASKLIST /S system /FO LIST
TASKLIST /S system /U domain\username /FO CSV /NH
TASKLIST /S system /U username /P password /FO TABLE /NH
TASKLIST /FI "USERNAME ne NT AUTHORITY\SYSTEM" /FI "STATUS eq running"
========================
TaskKill:
Quote:TASKKILL [/S system [/U username [/P [password]]]]
{ [/FI filter] [/PID processid | /IM imagename] } [/F] [/T]
Description:
This command line tool can be used to end one or more processes.
Processes can be killed by the process id or image name.
Parameter List:
/S system Specifies the remote system to connect to.
/U [domain\]user Specifies the user context under which
the command should execute.
/P [password] Specifies the password for the given
user context. Prompts for input if omitted.
/F Specifies to forcefully terminate
process(es).
/FI filter Displays a set of tasks that match a
given criteria specified by the filter.
/PID process id Specifies the PID of the process that
has to be terminated.
/IM image name Specifies the image name of the process
that has to be terminated. Wildcard '*'
can be used to specify all image names.
/T Tree kill: terminates the specified process
and any child processes which were started by it.
/? Displays this help/usage.
Filters:
Filter Name Valid Operators Valid Value(s)
----------- --------------- --------------
STATUS eq, ne RUNNING | NOT RESPONDING
IMAGENAME eq, ne Image name
PID eq, ne, gt, lt, ge, le PID value
SESSION eq, ne, gt, lt, ge, le Session number.
CPUTIME eq, ne, gt, lt, ge, le CPU time in the format
of hh:mm:ss.
hh - hours,
mm - minutes, ss - seconds
MEMUSAGE eq, ne, gt, lt, ge, le Memory usage in KB
USERNAME eq, ne User name in [domain\]user
format
MODULES eq, ne DLL name
SERVICES eq, ne Service name
WINDOWTITLE eq, ne Window title
NOTE: Wildcard '*' for the /IM switch is accepted only with filters.
NOTE: Termination of remote processes will always be done forcefully
irrespective of whether /F option is specified or not.
Examples:
TASKKILL /S system /F /IM notepad.exe /T
TASKKILL /PID 1230 /PID 1241 /PID 1253 /T
TASKKILL /F /IM notepad.exe /IM mspaint.exe
TASKKILL /F /FI "PID ge 1000" /FI "WINDOWTITLE ne untitle*"
TASKKILL /F /FI "USERNAME eq NT AUTHORITY\SYSTEM" /IM notepad.exe
TASKKILL /S system /U domain\username /FI "USERNAME ne NT*" /IM *
TASKKILL /S system /U username /P password /FI "IMAGENAME eq note*"
=============================
=============================
PrcView:
Quote:Usage: pv -[<MODE>] -[<OPTIONS>] <ARGUMENTS>...-[<OPTIONS>]
Modes:
-s --summary show usage for the specified MODULE
-h,-? --help display this help information
Actions:
-k --kill kill process
-a --activate brings process main window in the foreground
-c --close close (send WM_CLOSE) to the PROCESS
-p[nihr] --priority set priority to "Normal", "Idle", "High", "Real Time"
[ba] "Below Normal" and "Above Normal" only on W2K or higher
Output Options:
-e, --extend show additional information if available
-l, --long show command line (can also be a filter)
-q, --quiet supress headers and produce a tab-separated list
-b --bare show process ID only ()
Input Options:
-f, --force never prompt
-i, --id use process ID instead of the PROCESS name
Filters:
-l[mask] --long include processes with command line matching mask
-w[mask] --window show processes with visible windows matching mask,
-e includes in search also invisible windows
-u[mask] --usage show processes using modules that matches mask
-t[root] --tree display process tree starting starting from the root
Extra Information Options:
-g --getenv get startup environment for the PROCESS
-m --module show modules used by specified PROCESS
Execution Options:
-d[time] --delay delay time in milliseconds before executing command
-r[err] --repeat repeat command in a cycle, while (%ERRORLEVEL% > err)
-n --number %ERRORLEVEL% = negated number of matched processes
-x[a] --exit wait for the process completion (exit)
'a' flag waits for all processes, -d sets time-out
-@[file_name] read arguments from specified file or from
standard input after processing the command line
Arguments can contain '*' and '?' wildcards.
Use return code (%ERRORLEVEL%) in batch files:
0 - process found (negated number of processes if -n is specified)
1 - empty result set, 2 - programm error
Examples:
pv myprocess.exe get process ID for myprocess.exe.
pv -e get extended list of running processes.
pv -k sleep* kill all processes starting with "sleep"
pv -m -e explorer.exe get extended information about explorer's modules
pv -u oleaut*.dll list of all processes that use matching dll
pv -ph w*.exe set priority to hight for all matching processes
pv explorer.exe -l"*/S" looks for explorer process with /S switch
pv -r0 -d2000 calc.exe "2>nul" checks every 2 seconds if calc.exe is running
============================
============================
PSLIST:
Quote:usage: pslist [-?] [-d] [-m] [-x][-t][-s [n] [-r n] [\\computer [-u username] [-p password]] [name | pid]
-d This switch has PsList show statistics for all active threads on the system, grouping threads with their
owning process.
-m This switch has PsList show memory-oriented information for each process, rather than the default of CPU-
oriented information.
-x
With this switch PsList shows CPU, memory and thread information for each of the processes specified.
-t Show process tree.
-s [n] Run in task-manager mode, for optional seconds specified.
Press Escape to abort.
-r n Task-manager mode refresh rate in seconds (default is 1).
-u Specifies optional user name for login to remote computer.
-p Specifies optional password for user name. If you omit this you will be prompted to enter a hidden
password.
name Instead of listing all the running processes in the system, this parameter narrows PsList's scan to
those processes that begin with the name process. Thus:
pslist exp
would statistics for all the processes that start with "exp", which would include Explorer.
pid Instead of listing all the running processes in the system, this parameter narrows PsList's scan to the
process that has the specified PID. Thus:
pslist 53
would dump statistics for the process with the PID 53.
===========================
PSKILL:
Quote:usage: pskill [\\computer [-u username] [-p password]] <process name | process id>
-u
Specifies optional user name for login to remote computer.
-p
Specifies optional password for user name. If you omit this you will be prompted to enter a hidden password.
process id
Specifies the process ID of the process you want to kill.
process name
Specifies the process name of the process or processes you want to kill.
=============================