Killing process _ MySQL in batches in windows

Source: Internet
Author: User
In windows, killing processes in batches sometimes starts a series of processes due to viruses or other reasons, and sometimes kills the processes and removes them. Run taskkill to kill all of these processes:

C:/Users/NR> taskkill/F/im frontpg.exe
Successful: The Process "FRONTPG. EXE" has been terminated, and the PID is 3732.
Successful: The Process "FRONTPG. EXE" has been terminated, and the PID is 24544.
Successful: The Process "FRONTPG. EXE" has been terminated, and the PID is 3612.
Error: The Process "FRONTPG. EXE" cannot be terminated, and its PID is 8268.
Cause: The operation is not supported.
Successful: The Process "FRONTPG. EXE" has been terminated, and the PID is 7532.
Successful: The Process "FRONTPG. EXE" has been terminated, and the PID is 14184.
Successful: The Process "FRONTPG. EXE" has been terminated, and the PID is 18384.
Successful: The Process "FRONTPG. EXE" has been terminated, and the PID is 16888.
Successful: The Process "FRONTPG. EXE" has been terminated, and the PID is 3280.
Successful: The Process "FRONTPG. EXE" has been terminated, and the PID is 18660.
Successful: The Process "FRONTPG. EXE" has been terminated, and the PID is 26440.
Successful: The Process "FRONTPG. EXE" has been terminated, and the PID is 20764.
Successful: The Process "FRONTPG. EXE" has been terminated, and the PID is 15572.
Successful: The Process "FRONTPG. EXE" has been terminated, and the PID is 4292.
Successful: The Process "FRONTPG. EXE" has been terminated, and the PID is 19844.
Successful: The Process "FRONTPG. EXE" has been terminated, and the PID is 25036.
Successful: The Process "FRONTPG. EXE" has been terminated, and the PID is 13736.
Successful: The Process "FRONTPG. EXE" has been terminated, and the PID is 15024.
Successful: The Process "FRONTPG. EXE" has been terminated, and the PID is 14948.
Successful: The Process "FRONTPG. EXE" has been terminated, and the PID is 23048.
Successful: The Process "FRONTPG. EXE" has been terminated, and the PID is 9864.
Successful: The Process "FRONTPG. EXE" has been terminated, and the PID is 22948.
Successful: The Process "FRONTPG. EXE" has been terminated, and the PID is 14872.
Successful: The Process "FRONTPG. EXE" has been terminated, and the PID is 7708.
Successful: The Process "FRONTPG. EXE" has been terminated, and the PID is 21956.
Successful: The Process "FRONTPG. EXE" has been terminated, and the PID is 21884.
Successful: The Process "FRONTPG. EXE" has been terminated, and the PID is 6212.
Successful: The Process "FRONTPG. EXE" has been terminated, and the PID is 6948.
Successful: The Process "FRONTPG. EXE" has been terminated, and the PID is 17016.
Successful: The Process "FRONTPG. EXE" has been terminated, and the PID is 9436.
Successful: The Process "FRONTPG. EXE" has been terminated, and the PID is 15808.
Successful: The Process "FRONTPG. EXE" has been terminated, and the PID is 14692.
Successful: The Process "FRONTPG. EXE" has been terminated, and the PID is 10044.
Successful: The Process "FRONTPG. EXE" has been terminated, and the PID is 13520.
Successful: The Process "FRONTPG. EXE" has been terminated, and the PID is 11508.
Successful: The Process "FRONTPG. EXE" has been terminated, and the PID is 17388.
Successful: The Process "FRONTPG. EXE" has been terminated, and the PID is 23544.
Successful: The Process "FRONTPG. EXE" has been terminated, and the PID is 13896.
Successful: The Process "FRONTPG. EXE" has been terminated, and the PID is 14728.
Successful: The Process "FRONTPG. EXE" has been terminated, and the PID is 2996.
Successful: The Process "FRONTPG. EXE" has been terminated, and the PID is 4536.
Successful: The Process "FRONTPG. EXE" has been terminated, and the PID is 18868.
Successful: The Process "FRONTPG. EXE" has been terminated, and the PID is 14124.

Parameter description:

/F force termination

/IM process image name

Frontpg.exe process name

Refer:

Taskkill command details

The "Tasklist" command is a command line tool used to display all processes running on a local or remote computer, with multiple execution parameters.

Purpose:
End 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 connect.
/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 call 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: specify to display detailed information.
/FI filter displays a series of processes that match the filter.

-Eq,-ne: equal, not equal.
-Gt,-lt: greater, less.
-Ge,-le: greater or equal, less than or equal.
/FO format specifies the output format. Valid values: "TABLE", "LIST", and "CSV ".
/NH the specified column header should not be displayed in the output.
Only valid for "TABLE" and "CSV" formats.
--------------------------------------
Tasklist practice:

1. View local processes (especially valid 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 processes on the local machine. The display result of the local machine consists of the image name (process name), PID, session name, Session #, and memory usage.

2. view the services provided by system processes
The tasklist command can not only view system processes, but also view the services provided by each process.
Enter "tasklist/svc" at the command prompt. This shows the service used in each process. for example, every svchost.exe process is normal.

3. view the process List of calling the DLL module file
For example, we want to check which processes in the local system call the "shell32.dll" DLL module file.
Tasklist/m shell32.dll
The system displays the list of all processes that call the shell32.dll file.

4. use a filter to find the specified process
Enter TASKLIST/FI "USERNAME ne nt authority/SYSTEM"/FI "STATUS eq running" at the command prompt"
This lists all processes that are running in a non-"SYSTEM" state.

More ................
Tasklist/v/fi "PID gt 1000"/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 @ ssW23/nh



When talking about the "Tasklist" command, we have to mention the "taskkill" command. as its name suggests, it is used to end the process.

Taskkill
End 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 (the backslash cannot be used ). The default value is local computer.

/U Domain/UserName
Run this command using the account permissions of the user specified by UserName or Domain/UserName. /U can be specified only after/s. The default value is the permission of the user Currently logged on to the computer that issued the command.

/P Password
Specify the password of the user account specified in the/u parameter.

/Fi Filter
Type of the process to be terminated or not terminated. You can specify multiple filters. Use the wildcard character (*) to specify the names of all tasks or images. The following are valid filter names, operators, and values:

/Pid ProcessID
ID of the process to be terminated.

/Im ImageName
Specifies the image name of the process to be terminated. Use the wildcard character (*) to specify the names of all images.

/F
Specifies the process to be forcibly terminated. This parameter can be ignored for remote processes, and all remote processes will be forcibly terminated.

/T
Terminate a specified process and any sub-processes started by the process.

/?
Display help at a command prompt.

Note
? The "WindowTitle" and "Status" filters are not supported when the remote system is specified.
? The wildcard (*) can be accepted only when it is specified with the filter.
? Whether or not the/f parameter is specified, the end operation of the remote process is always enforced.
? Provide the HOSTNAME filter with a computer name that will cause shutdown and stop all processes.
? Use tasklist to determine the process ID (PID) of the process to be terminated ).
--------------------------------------
Taskkill practice
1. spoolsv.exe process
2. end all sub-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 @ ssW23/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 1000"/im *

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.