Terminate the process that occupies the port

In Windows, you can kill a process using a port by doing the following:

  1. Get the process ID (PID) of the port: Use the command prompt (Command Prompt) or PowerShell to execute the following command:

    
    netstat -ano | findstr :80
    

    This will display information about the process occupying port 80, including the process ID (PID).

  2. Kill the process: Open Task Manager, switch to the "Details" tab, and find the process with the corresponding PID. Right-click on the process and select "End Task" to terminate the process.

    Alternatively, you can execute the following command in Command Prompt or PowerShell to kill the process:

    taskkill /PID <PID> /F
    

Replace <PID>with the actual PID of the process to kill.

Note that terminating a process may result in the abnormal termination of the associated application or service. Before terminating a process, make sure you understand which application or service is terminating the process and confirm that terminating the process will not adversely affect the system.

Guess you like

Origin blog.csdn.net/qq_44113347/article/details/131762346