Batch kill process under Windows

Source: Internet
Author: User
Tags memory usage

Sometimes it starts a series of processes for viruses or other reasons, and sometimes kills this one and more. Use the command Taskkill to kill all of these processes at a draught:

c:usersnr>taskkill/f/im Frontpg.exe

Success: The process was terminated FRONTPG. EXE ", its PID is 3732.

Success: The process was terminated FRONTPG. EXE ", its PID is 24544.

Success: The process was terminated FRONTPG. EXE ", its PID is 3612.

Error: Unable to terminate process ' FRONTPG. EXE ", its PID is 8268.

Reason: The operation is not supported.

Success: The process was terminated FRONTPG. EXE ", its PID is 7532.

Success: The process was terminated FRONTPG. EXE ", its PID is 14184.

Success: The process was terminated FRONTPG. EXE ", its PID is 18384.

Success: The process was terminated FRONTPG. EXE ", its PID is 16888.

Success: The process was terminated FRONTPG. EXE ", its PID is 3280.

Success: The process was terminated FRONTPG. EXE ", its PID is 18660.

Success: The process was terminated FRONTPG. EXE ", its PID is 26440.

Success: The process was terminated FRONTPG. EXE ", its PID is 20764.

Success: The process was terminated FRONTPG. EXE ", its PID is 15572.

Success: The process was terminated FRONTPG. EXE ", its PID is 4292.

Success: The process was terminated FRONTPG. EXE ", its PID is 19844.

Success: The process was terminated FRONTPG. EXE ", its PID is 25036.

Success: The process was terminated FRONTPG. EXE ", its PID is 13736.

Success: The process was terminated FRONTPG. EXE ", its PID is 15024.

Success: The process was terminated FRONTPG. EXE ", its PID is 14948.

Success: The process was terminated FRONTPG. EXE ", its PID is 23048.

Success: The process was terminated FRONTPG. EXE ", its PID is 9864.

Success: The process was terminated FRONTPG. EXE ", its PID is 22948.

Success: The process was terminated FRONTPG. EXE ", its PID is 14872.

Success: The process was terminated FRONTPG. EXE ", its PID is 7708.

Success: The process was terminated FRONTPG. EXE ", its PID is 21956.

Success: The process was terminated FRONTPG. EXE ", its PID is 21884.

Success: The process was terminated FRONTPG. EXE ", its PID is 6212.

Success: The process was terminated FRONTPG. EXE ", its PID is 6948.

Success: The process was terminated FRONTPG. EXE ", its PID is 17016.

Success: The process was terminated FRONTPG. EXE ", its PID is 9436.

Success: The process was terminated FRONTPG. EXE ", its PID is 15808.

Success: The process was terminated FRONTPG. EXE ", its PID is 14692.

Success: The process was terminated FRONTPG. EXE ", its PID is 10044.

Success: The process was terminated FRONTPG. EXE ", its PID is 13520.

Success: The process was terminated FRONTPG. EXE ", its PID is 11508.

Success: The process was terminated FRONTPG. EXE ", its PID is 17388.

Success: The process was terminated FRONTPG. EXE ", its PID is 23544.

Success: The process was terminated FRONTPG. EXE ", its PID is 13896.

Success: The process was terminated FRONTPG. EXE ", its PID is 14728.

Success: The process was terminated FRONTPG. EXE ", its PID is 2996.

Success: The process was terminated FRONTPG. EXE ", its PID is 4536.

Success: The process was terminated FRONTPG. EXE ", its PID is 18868.

Success: The process was terminated FRONTPG. EXE ", its PID is 14124.

Parameter description:

/F Forced termination

/IM Process Image Name

Frontpg.exe Process Name

Reference:

Taskkill Command Detailed

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 to connect.

/u [domain]user specifies which user to use to execute this command.

/p [Password] specifies a password for the specified user.

/M [module] lists all processes that invoke the specified DLL module.

If you do not specify a module name, all modules loaded by each process are displayed.

/SVC displays the services in each process.

/v Specifies that you want to display detailed information.

/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 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.

--------------------------------------

Tasklist Combat:

1. View the native process (particularly effective when special circumstances such as Task Manager are disabled)

Run "cmd" and enter in the prompt window: "tasklist" to display all the processes on this machine. The display result of this machine consists 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 allows you to view not only system processes, but also the services provided by each process.

At the command prompt, enter: "Tasklist/svc", which lists the services invoked by each process, how is every svchost.exe process still normal, huh?

3. View the list of processes calling DLL module files

For example, we want to see which processes in the local system call the "Shell32.dll" DLL module file.

tasklist/m Shell32.dll

The system will then display a list of all the processes that called the Shell32.dll file.

4. Using a filter to find the specified process

At the command prompt, enter: tasklist/fi "USERNAME ne NT authoritysystem"/fi "STATUS eq Running"

This lists all processes running in the system that are not "system" states.

More......

tasklist/v/fi "PID GT 1000"/FO CSV

Tasklist/fi "USERNAME ne NT authoritysystem"/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 maindomhiropln/p P@SSW23/NH

When it comes to the "Tasklist" command, we have to refer to the "taskkill" command, which, as the name suggests, 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

Specifies the remote computer name or IP address (you cannot use a backslash). The default value is the local computer.

/u domainusername

Run the command with the account permissions of the user specified by UserName or domainusername. You can specify/U only after a/s is specified. The default value is the permissions that are available to users of the computer that is currently logged on to the publishing command.

/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 the wildcard character (*) to specify all tasks 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 terminate. Use the 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 initiated by the specified process and the process.

/?

Displays help at the command prompt.

Comments

-When specifying a remote system, the "WindowTitle" and "Status" filters are not supported.

-Wildcard characters (*) are accepted only when specified with the filter.

-The terminate operation to 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 all processes to be aborted.

-use tasklist to determine the process ID (PID) of the process to terminate.

--------------------------------------

Taskkill Combat

1. End the Spoolsv.exe process

2. End 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 authoritysystem"/im notepad.exe

taskkill/s srvmain/f/im notepad.exe

taskkill/s srvmain/u maindomhiropln/p p@ssw23/fi "imagename eq note*"/im *

taskkill/s srvmain/u maindomhiropln/fi "USERNAME ne nt*"/im *

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

taskkill/f/fi "PID GE 1000"/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.