I perform the following on Win7 32-Bit in the command prompt:

netstat -ano | findstr 8080

it returns with:

TCP               LISTENING       1896

how might I kill this process?

migrated from serverfault.com Sep 12 '14 at 5:00

This question came from our site for system and network administrators.


In windows you can use taskkill /pid 1896

See the reference at http://technet.microsoft.com/en-us/library/bb491009.aspx

  • It tells me access is denied. – cryptomath Sep 9 '14 at 2:22
  • 1
    Open a command prompt with the option "Run as Administrator". If you still have the same problem, then get the utility Process Explorer. – Marcelo Sep 9 '14 at 2:28
  • Horray! After running as administrator and performing: TaskKill /PID 1896 /F it solves my problem! – cryptomath Sep 9 '14 at 2:54
  • On Windows 10, taskkill did not work for me, even as Administrator, and even with /F. So I needed to use Process Explorer and go kill/delete all the relevant processes (which for me were 'ssh' and 'ssh-agent'. – Ryan Jan 13 '17 at 21:48

I'm using Josep's command above in a script because we have a problem where MS werfault.exe (Dr Watson) steals port 8080 from our proxy server.

It's a great command, but the find "8080" will also find a port of e.g 18080 or a process id that has 8080 in it. Subsequently the wrong task could be killed.

Can be improved by changing the find string to ":8080 " (note the trailing space)


  • Nice, thanks! :) I have edited my solution based upon your modification! – Josep Alsina Jul 17 '17 at 10:09

Open command prompt and execute:

for /f "tokens=5" %a in ('netstat -aon ^| find ":8080" ^| find "LISTENING"') do taskkill /f /pid %a

If you want to do it in a .bat, replace %a for %%a


If you are using Git BASH then you can try with below command

taskkill //pid 1896

Not the extra back slash here, otherwise it will throw error of invalid argument.

I hope it helps!!


For me following works on windows 10, so you guys can also try !!

First of all, find all the process which are running ona port.

For that use following command in cmd:

                                 netstat -ano | findstr <port_number>

After finding all the process running on a port, just use below command to terminate the process you want to terminate :

                    taskkill /F /pid  10608

10608 is the process which is going to be terminated.

  • 2
    This answer is pointless since it duplicates the already accepted answer. – xenoid Oct 28 '17 at 17:48

in linux u can use for kill process permanently

kill -9 PID

ex. I am going to kill httpd process and httpd pid is 7452 ok. then

#kill -9 7452 

But make sure u can use this process only for linux .

  • 1
    Please read the question again carefully. Your answer does not answer the original question. OP is using Windows not Linux – DavidPostill Aug 31 '16 at 7:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy