How to free a port on windows

You can use the “netstat” command from command prompt to determine which program is using any port.

Follow these steps:

1. Click Start, type cmd in the Start Search box, and then press ENTER.
If you are prompted for an administrator password or for a confirmation, type the password, or click Continue.
2. Type netstat –ano and hit enter.
This will provide a list of ports, along with the PID (process ID) that has those ports open.
(Shortcut: netstat -ano | findstr portNumber)

Command prompt:
taskkill /PID XXX (force kill: taskkill /F /PID XXX)

1. To determine what executable is running as a process ID, open Windows Task Manager and switch to the Processes tab.
2. Now click on View->Select Columns.
3. On the screen that opens, make sure “PID (Process Identifier)” is checked and then click OK.
4. Now click on the PID heading to sort the entries by PID.


8 responses to “How to free a port on windows

  1. It didn’t work for me. the port i wanna close is 936.
    how do i close it?
    pls i need a help me with the command line.
    I’m a Newbe to Computer Science

  2. could not connect to server: Connection refused (0x0000274D/10061)
    Is the server running on host “localhost” ( and accepting
    TCP/IP connections on port 5432?
    i wated to free this port , but when i l executed the command netstat , the process didn’t appear in the list , so i can’t have the PID , which mean i can’t execute the taskkill commande

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s