Bulk Kill process under windows

Source: Internet
Author: User

Sometimes, because of viruses or other reasons, a series of processes have been initiated and sometimes killed, and more that. Use the command Taskkill to kill these processes all at once:

c:\users\nr>taskkill/f/im Frontpg.exe
Success: The process "FRONTPG" has been terminated. EXE "with a PID of 3732.
Success: The process "FRONTPG" has been terminated. EXE "with a PID of 24544.
Success: The process "FRONTPG" has been terminated. EXE "with a PID of 3612.
Error: Unable to terminate process "FRONTPG. EXE "with a PID of 8268.
Cause: The operation is not supported.
Success: The process "FRONTPG" has been terminated. EXE "with a PID of 7532.
Success: The process "FRONTPG" has been terminated. EXE "with a PID of 14184.
Success: The process "FRONTPG" has been terminated. EXE "with a PID of 18384.
Success: The process "FRONTPG" has been terminated. EXE "with a PID of 16888.
Success: The process "FRONTPG" has been terminated. EXE "with a PID of 3280.
Success: The process "FRONTPG" has been terminated. EXE "with a PID of 18660.
Success: The process "FRONTPG" has been terminated. EXE "with a PID of 26440.
Success: The process "FRONTPG" has been terminated. EXE "with a PID of 20764.
Success: The process "FRONTPG" has been terminated. EXE "with a PID of 15572.
Success: The process "FRONTPG" has been terminated. EXE "with a PID of 4292.
Success: The process "FRONTPG" has been terminated. EXE "with a PID of 19844.
Success: The process "FRONTPG" has been terminated. EXE "with a PID of 25036.
Success: The process "FRONTPG" has been terminated. EXE "with a PID of 13736.
Success: The process "FRONTPG" has been terminated. EXE "with a PID of 15024.
Success: The process "FRONTPG" has been terminated. EXE "with a PID of 14948.
Success: The process "FRONTPG" has been terminated. EXE "with a PID of 23048.
Success: The process "FRONTPG" has been terminated. EXE "with a PID of 9864.
Success: The process "FRONTPG" has been terminated. EXE "with a PID of 22948.
Success: The process "FRONTPG" has been terminated. EXE "with a PID of 14872.
Success: The process "FRONTPG" has been terminated. EXE "with a PID of 7708.
Success: The process "FRONTPG" has been terminated. EXE "with a PID of 21956.
Success: The process "FRONTPG" has been terminated. EXE "with a PID of 21884.
Success: The process "FRONTPG" has been terminated. EXE "with a PID of 6212.
Success: The process "FRONTPG" has been terminated. EXE "with a PID of 6948.
Success: The process "FRONTPG" has been terminated. EXE "with a PID of 17016.
Success: The process "FRONTPG" has been terminated. EXE "with a PID of 9436.
Success: The process "FRONTPG" has been terminated. EXE "with a PID of 15808.
Success: The process "FRONTPG" has been terminated. EXE "with a PID of 14692.
Success: The process "FRONTPG" has been terminated. EXE "with a PID of 10044.
Success: The process "FRONTPG" has been terminated. EXE "with a PID of 13520.
Success: The process "FRONTPG" has been terminated. EXE "with a PID of 11508.
Success: The process "FRONTPG" has been terminated. EXE "with a PID of 17388.
Success: The process "FRONTPG" has been terminated. EXE "with a PID of 23544.
Success: The process "FRONTPG" has been terminated. EXE "with a PID of 13896.
Success: The process "FRONTPG" has been terminated. EXE "with a PID of 14728.
Success: The process "FRONTPG" has been terminated. EXE "with a PID of 2996.
Success: The process "FRONTPG" has been terminated. EXE "with a PID of 4536.
Success: The process "FRONTPG" has been terminated. EXE "with a PID of 18868.
Success: The process "FRONTPG" has been terminated. EXE "with a PID of 14124.

Parameter description:

/F Forced termination

/IM Process Image Name

Frontpg.exe Process Name

Reference:

Taskkill command Explanation

The "Tasklist" command is a command-line tool for displaying all processes running on a local or remote computer with multiple execution parameters.

Role:
Ends one or more tasks or processes. You can end a process based on the process ID or image name.

Syntax format:
TASKLIST [/S system [/u username [/p [password]]]
[/M [module] |/svc |/v] [/FI Filter] [/FO format] [/NH]

Parameter list:
/S system Specifies the remote system to which the connection is connected.
/u [domain\]user specifies which user to use to execute this command.
/p [Password] specifies the password for the specified user.
/M [module] lists all processes that invoke the specified DLL module.
If no module name is specified, all modules loaded by each process are displayed.
/SVC displays the services in each process.
/v Specifies that detailed information is to be displayed.
The/FI filter displays a series of processes that conform to the filter designation.

-eq,-ne:equal, not equal.
-GT,-lt:greater, less than.
-ge,-le:greater or equal, less than or equal.
/FO format Specifies the output formats, 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.
--------------------------------------
Tasklist Combat:

1. View native processes (particularly effective in some special cases, such as when the Task Manager is disabled)
Run "cmd" and enter the "tasklist" command in the prompt window to display all of the native processes. The results of this machine are composed of five parts: image name (process name), PID, session name, session #, memory usage.

2. View the services provided by the system process
The tasklist command not only allows you to view system processes, but also to view the services provided by each process.
At the command prompt, type: "Tasklist/svc", which lists the services that each process invokes, and how each Svchost.exe process is normal, huh?

3. View a list of processes that call DLL module files
For example, we want to see which processes in the local system called the "Shell32.dll" DLL module file.
tasklist/m Shell32.dll
The system displays a list of all processes that have called the Shell32.dll file.

4. Use filters to find the specified process
At the command prompt, enter: tasklist/fi "USERNAME ne NT authority\system"/fi "STATUS eq Running"
This lists all processes running in the system that are not "system" state.

More................
tasklist/v/fi "PID GT"/FO CSV

Tasklist/fi "USERNAME ne NT authority\system"/fi "STATUS eq Running"

tasklist/v/fi "STATUS eq Running"

tasklist/s srvmain/nh tasklist/s srvmain/svc/fi "Modules eq ntdll*"

tasklist/s srvmain/u maindom\hiropln/p [email protected]/nh


When it comes to the "Tasklist" command, we have to mention the "Taskkill" command, which, as the name implies, is used to end the process.

Taskkill
Ends one or more tasks or processes. You can end a process based on the process ID or image name.

Syntax: TASKKILL [/S system [/u username [/p [password]]]
{[/FI filter] [/pid ProcessID |/im imagename]} [/F] [/T]

Parameters
/s computer
Specify the remote computer name or IP address (you cannot use backslashes). The default value is the local computer.

/u domain\username
Run the command with the account permissions of the user specified by UserName or domain\username. /u can be specified only after the/s is specified. The default value is the permissions that the user of the computer that is currently logged on to the Publish command has.

/P Password
Specifies the password for the user account specified in the/u parameter.

/FI Filter
Specifies the type of process that will be terminated or not terminated. You can specify multiple filters. Use a wildcard character (*) to specify all task or image names. The following are valid filter names, operators, and values:

/pid ProcessID
Specifies the process ID of the process that will be terminated.

/im ImageName
Specifies the image name of the process that will be terminated. Use a wildcard character (*) to specify all image names.

/F
Specifies the process that will be forced to terminate. For remote processes to ignore this parameter, all remote processes will be forced to terminate.

/t
Terminates any child processes that the specified process started with the process.

/?
Displays help at the command prompt.

Comments
? The "WindowTitle" and "Status" filters are not supported when specifying a remote system.
? The wildcard character (*) is accepted only when specified with a filter.
? The terminate operation on the remote process is always enforced regardless of whether the/F parameter is specified.
? Supplying a computer name to the HOSTNAME filter causes the shutdown and aborts all processes.
? Use Tasklist to determine the process ID (PID) of the process to be terminated.
--------------------------------------
Taskkill Combat
1. End the Spoolsv.exe process
2. Ending all child processes of a process


Example
The following example shows how to use the Taskkill command:

Taskkill/pid 1230/pid 1241/pid 1253

taskkill/f/fi "USERNAME eq NT authority\system"/im notepad.exe

taskkill/s srvmain/f/im notepad.exe

taskkill/s srvmain/u maindom\hiropln/p [email protected]/fi "IMAGENAME eq note*"/im *

taskkill/s srvmain/u maindom\hiropln/fi "USERNAME ne nt*"/im *

Taskkill/pid 2134/t/fi "username EQ Administrator"

taskkill/f/fi "PID ge"/im *


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.