Have you ever found yourself in a situation where you want to run an application on your Windows computer using a specific port, but another process that you don’t need is using that port?

If so, you’re in the right place.

First, you need to run the command below using Windows CMD Prompt to identify the ID of the process that is currently using the port you need.

netstat -ano | findstr :8080

For example, check the command I executed on my machine to find the ID of the process using port 7001. After running the command, the terminal displayed the process ID, which is 4024.

netstat command to find the process using a port on windows

After obtaining the PID (Process ID), you can execute the command below to terminate the process.

/PID indicates that we are attempting to terminate the task by its PID, while /F will forcefully terminate the task.

After execution, the task will end immediately, releasing the port for use by other processes.

Categorized in:

Tagged in: