CMD port usage view and close the port

Source: Internet
Author: User
CMD -- press enter and enter netstat-ano -- Press enter. You can view the occupied port, write down the PID of the port, open the task manager, click View, select the column, and check the PID, find the corresponding PID and end the process. If the process cannot be completed or it does not take effect after the end, use the ntsd command.

Solution to Tomcat port occupation

If the previously occupied port is not occupied, but is later occupied, run shutdown. BAT in D:/tomcat-5.5.26/bin to release the occupied port.

If the Task Manager cannot end the process, run the following command:

CMD -- press enter, enter ntsd-C q-p pid -- press ENTER

Ntsd-C q-p pid (change the last PID to the PID of the process you want to terminate ). You can find the PID of a process in the process list.

The above-p parameter indicates that the PID is followed by the process, and-C q indicates that the DEBUG command to exit ntsd is executed, and the above parameters can be passed through the command line.

The Windows system comes with a user-mode debugging tool ntsd. You can use ntsd to call up a process on the command line and then exit ntsd to terminate the process. ntsd automatically grants the debug permission, therefore, ntsd can kill most processes.

Processes that ntsd cannot kill: only system, SMSs. EXE, and CSRSS. EXE cannot kill. The first two are pure kernel state, and the last one is the Win32 subsystem. ntsd needs it.
In addition, the tskill command is also an option to kill the process.

Tasklist can list all processes and related information.

Tskill can kill processes based on the PID (process ID) process name.



The following describes how to use tskill.

Tskill processid | processname [/Server: servername] [/ID: sessionid |/A] [/V]

The process ID of the process whose processid is to end.
The name of the process whose processname is to end.
/Server: the server whose servername contains processid (the default value is the current value ).
When using the process name and/server, you must specify/ID or/
/ID: sessionid ends the process running in the specified session.
/A ends the processes running in all sessions.
/V displays the information of the operation being executed.
The following describes how to use tasklist.

Tasklist [/S system [/u username [/P [Password]
[/M [module] |/svc |/V] [/FI filter] [/FO format] [/NH]

Description:
The tool displays the list of processes currently running on local or remote machines.

Parameter List:
/S system specifies the remote system to connect.
/U [domain/] User specifies the user context in which the command should be executed.
/P [Password] specifies a password for the provided user context. If ignored, the following message is displayed:
Input.
/M [module] lists all tasks with the name of the EXE/DLL currently used.
If no module name is specified, all loaded modules are displayed.
/Svc displays the Services hosted in each process.
/V displays Detailed task information.
/FI filter displays a series of tasks that meet the criteria specified by the filter.
/FO format specifies the output format.
Valid values: "table", "list", and "CSV ".
The/NH specified column title should not be displayed in the output.
Only valid for "table" and "CSV" formats.
/? Displays help messages.

CMD port usage view and close the port

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.