Rotation: http://blog.sina.com.cn/s/blog_55fb522f0100whki.html
1, start-run (or win+r), input cmd, open command line mode;
2. Enter tasklist to view all processes
3. Input Tasklist/fi "imagename eq nginx. EXE ", you can view the name of
Nginx. EXE for all the processes, here nginx. EXE can be modified to the name of the process you want to find
4. Input Taskkill/fi "imagename eq nginx. EXE "/F, can kill name for
Nginx. EXE for all processes
Command parameter parsing:
/FI: Switches for filters
ImageName: For Filter name
/F: for forced shutdown
Detailed parameter explanation can be viewed through tasklist/? and Taskkill/?
C:\Documents and Settings\administrator>tasklist/?
TASKLIST [/S system [/u username [/p [password]]]
[/M [module] |/svc |/v] [/FI Filter] [/FO format] [/NH]
Describe:
This command-line tool displays the application and local
or a related task/process running on a remote system.
List.
Parameter list:
/S system Specifies the remote system to which the connection is connected.
/u [domain\]user Specifies which user context should be in
Execute this command.
/p [Password] specifies for the provided user context
Password. If omitted, prompt for input.
/M [Module] lists all of them that match the specified schema name
All tasks for the DLL module.
If no module name is specified, the
Displays all modules loaded by each task.
/SVC displays the services in each process.
/v Specifies to display detailed
Information.
/FI Filter Displays a list of criteria that conform to the filter specification
The task.
The output format is specified by the/FO 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 help/usage.
Filter:
Filter name valid operator valid value
----------- --------------- --------------
STATUS eq, NE is running | No response
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, format
Hh:mm:ss.
HH-When,
MM-min, ss-Sec
Memusage eq, NE, GT, lt, ge, le memory usage (KB)
USERNAME eq, NE user name, format [domain\]
User
Services EQ, NE service name
WindowTitle eq, NE window title
MODULES eq, NE DLL name
For example:
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
C:\Documents and Settings\administrator>
C:\Documents and Settings\administrator>taskkill/?
TASKKILL [/S system [/u username [/p [password]]]
{[/FI filter] [/pid ProcessID |/im imagename]} [/F] [/T]
Describe:
This command-line tool can be used to end at least one process.
You can end a process based on the process ID or image name.
Parameter list:
/S system Specifies the remote system to connect to.
/u [domain\]user Specifies which user context should be in
Execute this command.
/p [Password] specifies for the provided user context
Password. If omitted, prompt for input.
/f Specifies to forcibly terminate
Process.
/FI filter Specifies that the query is filtered into or filtered out of the
The task.
The/PID process ID specifies the
Pid.
/IM image name Specifies the process to terminate
The image name. wildcard character ' * '
Can be used to specify all image names.
/T Tree Kill: Terminates the specified process
And any child processes that are started from this.
/? Displays help/usage.
Filter:
Filter name valid operator valid value
----------- --------------- --------------
STATUS eq, ne run | No response
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, format
Hh:mm:ss.
HH-When,
MM-Clock, SS-Sec
Memusage eq, NE, GT, lt, GE, le memory used, in kilobytes
USERNAME eq, NE user name, formatted as
[Domain\]user
MODULES eq, NE DLL name
Services EQ, NE service name
WindowTitle eq, NE window title
Note: The wildcard ' * ' can be used with the/im switch only with a filter.
Note: Remote processes are always forced to terminate,
Whether or not the/F option is specified.
For example:
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/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*"
C:\Documents and Settings\administrator>
Windows batch kill process is similar to Pkill